Hi, I am looking at a list of options using a "Select Case" function in VBA, and based on the result, want to put data in a certain row on the spreadsheet. I could put
Case 1
Range("h3").Value = txtDate.Text
Range("i3").Value = txtTime.Text
Case 2
Range("h4").Value = txtDate.Text
Range("i4").Value = txtTime.Text
etc etc, but theres several data items for each line, and bunch of possible lines, so that would get unwieldy. I'd rather do something like..
Case 1
RowNo = 3
Case 2
RowNo =4
Range("h'RowNo'").Value = txtDate.Text
But I don't know how. Any tips on using a variable as part of a cell address ?
Thanks,
Richard
Case 1
Range("h3").Value = txtDate.Text
Range("i3").Value = txtTime.Text
Case 2
Range("h4").Value = txtDate.Text
Range("i4").Value = txtTime.Text
etc etc, but theres several data items for each line, and bunch of possible lines, so that would get unwieldy. I'd rather do something like..
Case 1
RowNo = 3
Case 2
RowNo =4
Range("h'RowNo'").Value = txtDate.Text
But I don't know how. Any tips on using a variable as part of a cell address ?
Thanks,
Richard