cambralenta
03-28-2013, 04:09 PM
I have recorded a macro that i need to use in sheet1:
Range("AZ1:AZ58").Select
Selection.Copy
Columns("AI:AI").Select
Range("AI1").Activate
Selection.Insert Shift:=xlToRight
Range("Q1:Q58").Select
Selection.Copy
Columns("AJ:AJ").Select
Range("AJ1").Activate
Selection.Insert Shift:=xlToRight
What I need is to change the code and copy from AZ column only if colum AG as values in it!
AG AI AJ AK AZ
xa 1
xb 2
3
4
5
The result should be:
AG AI AJ AK AZ
xa 1 Q1 1
xb 2 Q2 2
xc 3 Q3 3
4
5
Q1:Q58 has fixed values, but AG1:AG58 donīt (dynamic).
Iīm really new to VBA so I hope that some one can help me! Thanks... :bow:
Range("AZ1:AZ58").Select
Selection.Copy
Columns("AI:AI").Select
Range("AI1").Activate
Selection.Insert Shift:=xlToRight
Range("Q1:Q58").Select
Selection.Copy
Columns("AJ:AJ").Select
Range("AJ1").Activate
Selection.Insert Shift:=xlToRight
What I need is to change the code and copy from AZ column only if colum AG as values in it!
AG AI AJ AK AZ
xa 1
xb 2
3
4
5
The result should be:
AG AI AJ AK AZ
xa 1 Q1 1
xb 2 Q2 2
xc 3 Q3 3
4
5
Q1:Q58 has fixed values, but AG1:AG58 donīt (dynamic).
Iīm really new to VBA so I hope that some one can help me! Thanks... :bow: