Question : VBA read variable into range

I want the user to specify how long to make the row....so I want to use the following code...
Set rngTblRcds = Sheets("Data").Range("A2:GB" & sSimNum)

so if the user entered 10 in the inoutbox..then it should be with the varaible reading:

Set rngTblRcds = Sheets("Data").Range("A2:GB10")

Any ideas on how to get that to work??

Answer : VBA read variable into range

Use the following code...

Saurabh

1:
2:
3:
Dim ssimnum As Long
ssimnum = Application.InputBox("Enter Row Number", "Row Number", Type:=1)
Set rngTblRcds = Sheets("Data").Range("A2:GB" & ssimnum)
Random Solutions  
 
programming4us programming4us