placing "X" at offset point

jarhead58

Active Member
Joined
Sep 21, 2017
Messages
348
Office Version
  1. 2016
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

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

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