assign text only if current cell is in range g100:g220

exceltadpole

Board Regular
Joined
Jan 14, 2004
Messages
108
I am updating an old sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub

How do assign the text "Received, Payment Due Immediately" to the current cell ONLY IF the current cell is in the range g100:g220 ?
The user has to scroll thru 200+ cells this would certainly speed up the data entry and avoid spelling mistakes.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Here is the pseudo code for what I need

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

if the current cell is in the range g100:g220 then
current cell = "Received, Payment Due Immediately"
end if

End Sub
 
Upvote 0
Hello, try the following:

<font face=Courier New><SPAN style="color:darkblue">Private</SPAN> <SPAN style="color:darkblue">Sub</SPAN> Worksheet_SelectionChange(<SPAN style="color:darkblue">ByVal</SPAN> Target <SPAN style="color:darkblue">As</SPAN> Range)
<SPAN style="color:darkblue">If</SPAN> <SPAN style="color:darkblue">Not</SPAN> Intersect(Target(1, 1), [g100:g220]) <SPAN style="color:darkblue">Is</SPAN> <SPAN style="color:darkblue">Nothing</SPAN> Then _
    Target(1, 1) = "Received, Payment Due Immediately"
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">Sub</SPAN></FONT>

But, would it not be better to have a Change event that completed the entry based on a different entry?
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,317
Members
448,564
Latest member
ED38

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