Hello,
I am currently struggling to get my first loop working. When i run it i get "Run-time error '1004': Application-defined or object-defined error".
This is the code that I am currently trying to run:
Any thoughts as to why I would be getting such an error?
I can run this code without the loop as follows and it works fine:
Many thanks in advance.
I am currently struggling to get my first loop working. When i run it i get "Run-time error '1004': Application-defined or object-defined error".
This is the code that I am currently trying to run:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim oneAddresses As Range
For Each oneAddress In Worksheets("VBA").Range("B2:B300").Cells
With Sheets("Aust Fixed").Range(oneAddress.Value)
ActiveSheet.Shapes(oneAddress.Offset(0, 1).Value).TextFrame.Characters.Font.Color = RGB(IIf(.Value < 0, 255, 0), 0, 0)
End With
Next oneAddress
End Sub
Any thoughts as to why I would be getting such an error?
I can run this code without the loop as follows and it works fine:
Code:
With Sheets("Aust Fixed").Range("B259")
ActiveSheet.Shapes("TextBox 664").TextFrame.Characters.Font.Color = RGB(IIf(.Value < 0, 255, 0), 0, 0)
End With
Many thanks in advance.