Pat_The_Bat
Board Regular
- Joined
- Jul 12, 2018
- Messages
- 83
I'm trying to set a Variable = to a range, but rather than defining the range in the code, I want to reference a cell in Excel. So I could go to the cell in Excel and type in "D4:D10" and that would become the range that the variable ='s
but then if I type into that cell in excel "D4:D15", NOW that would be the range the variable is = to.
Basically don't want to change the code every time I need to make a change to that range. I'd rather direct input it into a cell in Excel as it may come up frequently.
appreciate the help!
but then if I type into that cell in excel "D4:D15", NOW that would be the range the variable is = to.
Basically don't want to change the code every time I need to make a change to that range. I'd rather direct input it into a cell in Excel as it may come up frequently.
Code:
Dim WageRange As String
Dim LstRow1 As Integer
Dim LstRow2 As Integer
Dim LstRow3 As Integer
Dim LstRow4 As Integer
With Worksheets("Doc Request")
Bor1 = .Range("B3").Value
Bor2 = .Range("C3").Value
Bor3 = .Range("D3").Value
Bor4 = .Range("E3").Value
Debug.Print Bor1
Debug.Print Bor2
Debug.Print Bor3
Debug.Print Bor4
End With
With Worksheets("Master")
WageRange = .Range("B3").Value
End With
Debug.Print WageRange
[COLOR=#000000] [/COLOR]
[B][COLOR=#000000] Set Wage1 = Worksheets("Master").Range("WageRange")[/COLOR][/B]
Set Self = Worksheets("Master").Range("B20:B25")
Set Fixed1 = Worksheets("Master").Range("B27:B30")
Set Fixed2 = Worksheets("Master").Range("B33:B39")
appreciate the help!