ChristineJ
Well-known Member
- Joined
- May 18, 2009
- Messages
- 761
- Office Version
- 365
- Platform
- Windows
In my worksheet cell P3 contains the text value ID. I will have many other similar worksheets where ID appears in row 3, but not necessarily in column P. The value ID appears only once in the entire worksheet.
I pulled out three snippets of code (out of many) from a macro.
1. ThisWorkbook.ActiveSheet.Range("P4").Value & "'"
2. Select Case InfoBox.Popup("Take " & Range("Q4").Value - 1 & " of
3. Range("O19:O23").Select
What I would like for #1 above is instead of "P4" being typed in above, for it to locate the cell where ID is in the worksheet and automatically set the cell address to the same column ID is in, row 4.
For#2 above, instead of "Q4" being typed in above, it would locate the cell where ID is in the worksheet and automatically set the cell address to one column to the right, row 4.
Similarly, for #3 above, instead of "O19" and "O23" being typed in, it would locate the cell where ID is in the worksheet and automatically set the cell address to one column to the left, rows 19 and 23 respectively.
I pulled out three snippets of code (out of many) from a macro.
1. ThisWorkbook.ActiveSheet.Range("P4").Value & "'"
2. Select Case InfoBox.Popup("Take " & Range("Q4").Value - 1 & " of
3. Range("O19:O23").Select
What I would like for #1 above is instead of "P4" being typed in above, for it to locate the cell where ID is in the worksheet and automatically set the cell address to the same column ID is in, row 4.
For#2 above, instead of "Q4" being typed in above, it would locate the cell where ID is in the worksheet and automatically set the cell address to one column to the right, row 4.
Similarly, for #3 above, instead of "O19" and "O23" being typed in, it would locate the cell where ID is in the worksheet and automatically set the cell address to one column to the left, rows 19 and 23 respectively.