yoinkster
08-08-2008, 03:29 AM
Hey guys,
I am totally new to trying to hack together macros so I'd be grateful if you could spare my a few minutes to impart some knowledge :P
a) How do you address a variable in VBA ? I'm trying to do an automatic find in my macro and it has
Selection.find(What:="4" *etc*
and what I want to tell it to do is find the value of my variable i, I tried to change it to
Selection.find(What:=i *etc*
but it whinged and obviously finding "i" is no use :P
b) How do you concatenate fixed strings and variables ? I'm trying to select a specific range a column and the basic command is
Range("A1").Select
but I want to do something like
Range(Ai).Select
so that in the loop it selects A1, then A2 then A3 etc.
c) Can you address the looping variable within the loop ?
For example if I am looping over j from 1 to 5, can I address the j in the loop and use it as 1,2,3,4,5 as the loop repeats ?
I think that's all I need for now, thanks :beerchug:
I am totally new to trying to hack together macros so I'd be grateful if you could spare my a few minutes to impart some knowledge :P
a) How do you address a variable in VBA ? I'm trying to do an automatic find in my macro and it has
Selection.find(What:="4" *etc*
and what I want to tell it to do is find the value of my variable i, I tried to change it to
Selection.find(What:=i *etc*
but it whinged and obviously finding "i" is no use :P
b) How do you concatenate fixed strings and variables ? I'm trying to select a specific range a column and the basic command is
Range("A1").Select
but I want to do something like
Range(Ai).Select
so that in the loop it selects A1, then A2 then A3 etc.
c) Can you address the looping variable within the loop ?
For example if I am looping over j from 1 to 5, can I address the j in the loop and use it as 1,2,3,4,5 as the loop repeats ?
I think that's all I need for now, thanks :beerchug: