placing "X" at offset point

jarhead58

Active Member
Joined
Sep 21, 2017
Messages
367
Office Version
  1. 2021
Platform
  1. Windows
Hi everyone!!

The following code had been working;

Code:
Sub Prodigal()Dim x As Range


If IsEmpty(Sheets("Watched").Range("I2")) = True Then
    Sheets("Watched").Range("I2") = "X"
Else
[COLOR=#ff0000]    If IsEmpty(Sheets("Watched").Range("I2")) = False Then[/COLOR]
[COLOR=#ff0000]        Set x = Sheets("Watched").Range("I2:I26").Find("X", LookIn:=xlValues)[/COLOR]
[COLOR=#ff0000]        If x.Address <> "$I$26" Then[/COLOR]
[COLOR=#ff0000]            x.Offset(7, 0) = "X"[/COLOR]
[COLOR=#ff0000]ElseIf x.Address = "$I$26" Then[/COLOR]
    
    MsgBox "Time to change the range!"


End If
End If
End If
End Sub

But when I changed the range in the red section to the following;

Code:
Sub Prodigal()Dim x As Range


If IsEmpty(Sheets("Watched").Range("I2")) = True Then
    Sheets("Watched").Range("I2") = "X"
Else
[COLOR=#ff0000]    If IsEmpty(Sheets("Watched").Range("I2")) = False Then[/COLOR]
[COLOR=#ff0000]        Set x = Sheets("Watched").Range("I2:I500").Find("X", LookIn:=xlValues)[/COLOR]
[COLOR=#ff0000]        If x.Address <> "$I$500" Then[/COLOR]
[COLOR=#ff0000]            x.Offset(7, 0) = "X"[/COLOR]
[COLOR=#ff0000]ElseIf x.Address = "$I$500" Then[/COLOR]
    
    MsgBox "Time to change the range!"


End If
End If
End If
End Sub

It didn't work; no errors! Any ideas?

TIA
 
You're welcome & thanks for the feedback
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,224,912
Messages
6,181,699
Members
453,063
Latest member
DoingWorkThings

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top