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
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

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???
 

Watch MrExcel Video

Forum statistics

Threads
1,118,680
Messages
5,573,624
Members
412,539
Latest member
itchy00
Top