Hi Guys!
I would like to declare a variable that uses a value from another variable. (is this known as dynamic variables?)
The offending line is:
where NumEntry is the variable within another variable, Wbq.
It looks like this in the whole code text:
Can anyone help me please?
Paddy
I would like to declare a variable that uses a value from another variable. (is this known as dynamic variables?)
The offending line is:
Code:
Wbq = ThisWorkbook.Sheets("Sheet 1").Cells(NumEntry, 2).Value
where NumEntry is the variable within another variable, Wbq.
It looks like this in the whole code text:
Code:
Sub Collation()
ThisWorkbook.Sheets("Collation").Range("B2:F12").ClearContents
Dim DiffcalcWb As Integer
Dim Wborig As Integer
Dim Wbq As Integer
NumEntry = ThisWorkbook.Sheets("Collation").Range("L2").Value
Wborig = ThisWorkbook.Sheets("Sheet 1").Range("B2").Value
Wbq = ThisWorkbook.Sheets("Sheet 1").Cells(NumEntry, 2).Value
DiffcalcWb = Wborig - Wbq
Sheets("Collation").Select
Range("B2").Value = DiffcalcWb
Can anyone help me please?
Paddy