Small Paul
Board Regular
- Joined
- Jun 28, 2018
- Messages
- 118
Hi
I have the following section of code within a large macro:
"Sheets Detail" takes you to a specific worksheet. The first instance works above (not the first in the macro) works correctly. For some bizarre reason I am getting a
"Run Time Error 9: Subscript Out Of Range" error on the second case above.
Both instances are pointing to the same worksheet!
Any suggestions as to what I am doing wrong?
Cheers
Small Paul.
I have the following section of code within a large macro:
Code:
Worksheets("Dubai Data").ActivateActiveCell.Offset(0, 2).Copy
detail = ActiveCell.value
[I]Sheets(detail).Select
[/I]
ActiveCell.Offset(-2, 1).PasteSpecial xlPasteValues
ActiveCell.Font.Bold = True
Range(cells(ActiveCell.row, "C"), cells(ActiveCell.row, "K")).MergeCells = True
Range("C8:K8").HorizontalAlignment = xlCenterAcrossSelection
Worksheets("Dubai Data").Activate
ActiveCell.Offset(0, 13).Select
If Selection.value <> "None" Then
Selection.Copy
ActiveCell.Select
detail = ActiveCell.value
[I]Sheets(detail).Select[/I]
Range("B4").PasteSpecial xlValues
"Sheets Detail" takes you to a specific worksheet. The first instance works above (not the first in the macro) works correctly. For some bizarre reason I am getting a
"Run Time Error 9: Subscript Out Of Range" error on the second case above.
Both instances are pointing to the same worksheet!
Any suggestions as to what I am doing wrong?
Cheers
Small Paul.
Last edited: