While writing a VBA macro I have tried to select a certain cell by storing both the column letter and the row number separately then putting them together with range(X + Y).select however it is not accepting the number half of it (it does work if I just manually type the number that's stored). Is there a certain way I need to store the number or write it for it be accepted?
I'm getting Type Mismatch in the debug so I'm assuming I've used the wrong word somewhere for something.
Teaching myself excel VBA currently so apologies if it's an easy error that I have just missed.
A simplified version without the extra fluff like named sheets ect. basically looks like below
Dim NVCurrRN As Integer
Dim Prod As Variant
Prod = "B"
Sheets("Sheet2").Select
Range("A1").Select
ActiveCell.Offset(1, 0).Select
NVCurrRN = ActiveCell.Row
Range(Prod + NVCurrRN).Select
When looking at it while debugging Prod = "B" correctly and NVCurrRN = 2, I have tried various other ways trying to get it to work but couldn't work it out though I'm sure I've used something similar in the past with no issues.
(This is taking place in a loop if that changes anything, the error shows on the first run though so I don't think there is any issue with that portion.)
(Edited as I didn't realise the example I made confused people with my objective, my mistake, the first range was not meant to lead to the same place as the select at the bottom goes to.)