Deselecting cells and returning to certain cell using VB

mon03

New Member
Joined
Oct 28, 2005
Messages
4
Hi

I currently use the VB code listed below.

If (str = "INIT") Then
Worksheets("Main").Range(apptcell).Select
Selection.Interior.Color = RGB(255, 255, 0)
End If

The problem with this is used as part of data entry. Ie when "INIT" is typed it is at the end of the data entry, and when you press enter it does not return to say cell A5, rather it stays selected. How can I get it to return to cell A5 once i press enter? rather than have to press enter, then down arrow then home to return to cell A5. It is currently in cell E4

Any assistance would be greatly appreciated

Thanks
Mon
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Nimrod

MrExcel MVP
Joined
Apr 29, 2002
Messages
6,259
Hello mon03:
Have you thought about using the "Form..." wizard found on the "Data" menu for data entry ??
 

mon03

New Member
Joined
Oct 28, 2005
Messages
4
The data entry is actually selected from a drop down list, where there are different options to select and each option has to be formatted accordingly.

Can I use a form for this???
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,023
Messages
5,834,996
Members
430,331
Latest member
Syed Yasir Hannan

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
Top