kyrgan
Active Member
- Joined
- Mar 23, 2006
- Messages
- 309
Hello;
I am trying to run a VBA script since I can't use condtional formatting across sheets.
When I get to :
I get the very informative 1004 error.
I am not sure if this is the best method, any help is appreciated.
Thanks
K.
I am trying to run a VBA script since I can't use condtional formatting across sheets.
When I get to :
Code:
Sheets(CompareSheetName).Range(Cells(CompareLoop, 44)).Select
I get the very informative 1004 error.
Code:
Sub FindSamePLUs()
Dim MasterLoop As Integer
Dim CompareLoop As Integer
Dim MasterSheetName As String
Dim CompareSheetName As String
MasterSheetName = "Boise"
CompareSheetName = "Delta Waters"
For MasterLoop = 2 To 257 Step 1
If Sheets(MasterSheetName).Cells(MasterLoop, 5) = 0 Then
For CompareLoop = 2 To 257 Step 1
If Sheets(MasterSheetName).Cells(MasterLoop, 5) = Sheets(CompareSheetName).Cells(CompareLoop, 5) Then
Sheets(CompareSheetName).Range(Cells(CompareLoop, 44)).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
Next
Next
End Sub
I am not sure if this is the best method, any help is appreciated.
Thanks
K.