I've been writing macros for a while and for some reason I can't get a varaible in my formula to work correctly. This is a very simple macro this is just going to concatenate two cells (one static, the other a variable) and it's not working right. I've tried everythign I can think of and I'm stuck.
Thanks,
-Jeff-
- ---------------------------------------------
count1 = 2
sheet = 7
Sheets(sheet).Select
Do While count1 < 15
Cells(1, count1).Select
ActiveCell.Formula = CONCATENATE(Cells(1, 1).Value, Cells(count1, 5).Value)
count1 = count1 + 1
Loop
- ---------------------------------------------
I have tried everything know of to get this to work with no luck
ActiveCell.Formula = "Concatenate(A1,B5)"
The above code is the only way I can get it to work, but I need the B5 to be a variable.
Thanks,
-Jeff-
- ---------------------------------------------
count1 = 2
sheet = 7
Sheets(sheet).Select
Do While count1 < 15
Cells(1, count1).Select
ActiveCell.Formula = CONCATENATE(Cells(1, 1).Value, Cells(count1, 5).Value)
count1 = count1 + 1
Loop
- ---------------------------------------------
I have tried everything know of to get this to work with no luck
ActiveCell.Formula = "Concatenate(A1,B5)"
The above code is the only way I can get it to work, but I need the B5 to be a variable.