gtd526
Well-known Member
- Joined
- Jul 30, 2013
- Messages
- 657
- Office Version
- 2019
- Platform
- Windows
Hello,
Within a macro, I use the following code:
Rng is used multiple times in the macro, but stays the same value.
The Rng = 1 but its going to J:J, representing 10. I want it to return 1, according to the cell value. The Rng will range from 1-18, depending on the cell value.
Here is the range of data im using:-
Within a macro, I use the following code:
SQL:
Dim Rng As Range
Set Rng = Worksheets("Weekly Picks").Range("B1")
Sheets("Weeks").Select
Set foundRng = Range("2:2").Find(Rng) 'using Row 2 to find Rng
'MsgBox (foundRng)
If Not (foundRng Is Nothing) Then
foundRng.Select
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Copy
Sheets("Weekly Picks").Select
Range("A4").Select
ActiveSheet.Paste
Else
End If
Rng is used multiple times in the macro, but stays the same value.
The Rng = 1 but its going to J:J, representing 10. I want it to return 1, according to the cell value. The Rng will range from 1-18, depending on the cell value.
Here is the range of data im using:-
NFL.xlsm | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | |||
1 | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | WEEK | ||
2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ||
Weeks |