pduffer
03-28-2003, 11:42 AM
I have a macro that prompts for a number to be stored in the variable I've named myNum. If I then use that variable in a cell reference such as Cells(myNum,1) it works well. But if I use it on the other side of the comma such as Cells(1,myNum) I get an error message. I can't understand why it makes a difference - or how to correct it. If I manually enter the number instead of using the variable - as in Cells(1,10) - it works fine.
Any help?
pduffer
pduffer
03-28-2003, 12:16 PM
I figured out a solution. I added the statement: DIM myNum As Integer to my Sub procedure and that took care of it.
I have a macro that prompts for a number to be stored in the variable I've named myNum. If I then use that variable in a cell reference such as Cells(myNum,1) it works well. But if I use it on the other side of the comma such as Cells(1,myNum) I get an error message. I can't understand why it makes a difference - or how to correct it. If I manually enter the number instead of using the variable - as in Cells(1,10) - it works fine.
Any help?
pduffer