GiraffetheGeek
Board Regular
- Joined
- May 25, 2011
- Messages
- 58
Hi all,
I must be brain dead today.
I am trying to get VB to select a number of cells based on the variable myline.
My code is:
I get the error message "Compile error: Wrong number of arguments or invalid property assignment"
I have drawn a blank. I know I've done this before but cannot remember how!
Also while I am here can anyone suggest a more efficient way of doing this if I need to increase the number of cells, ie increase from B,E,H,K,N on the same line to maybe 20 different cells on the same line?
Cheers in advance
I must be brain dead today.
I am trying to get VB to select a number of cells based on the variable myline.
My code is:
Code:
Range("B" & myline, "E" & myline, "H" & myline, "K" & myline, "N" & myline).Select
I get the error message "Compile error: Wrong number of arguments or invalid property assignment"
I have drawn a blank. I know I've done this before but cannot remember how!
Also while I am here can anyone suggest a more efficient way of doing this if I need to increase the number of cells, ie increase from B,E,H,K,N on the same line to maybe 20 different cells on the same line?
Cheers in advance