Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Tabbing out of Blank Cell

I'm working in Excel 2002

I have a table with 18 columns where the user enters numeric values. The
sheet is proctected, the cells the user inputs information into are unlocked.
Currently I have the following coding:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 18 Then
Cells(Target.Row, 1).Select
End If
End Sub

What this does is if the user tabs out of column 18, row 3 for example, the
cursor goes to column A in the same row.

The above coding works only if there is a numeric value in the cell in
column 18. How can I get the above coding to work if the user leaves the
cell blank?

Thanks.

--
Jamie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Tabbing out of Blank Cell

Jamie

Use selection_change

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 18 Then
Cells(Target.Row, 1).Select
End If
End Sub

Why go back to column A in the same row? Wouldn't you want to drop down one
row for entering the next set of data?

If that were the case, you would not need event code, just TAB out of column
18 and you will go to column A 1 row down.

Assuming all other columns are locked, of course.


Gord Dibben Excel MVP

On Fri, 1 Apr 2005 16:19:03 -0800, "Jamie"
wrote:

I'm working in Excel 2002

I have a table with 18 columns where the user enters numeric values. The
sheet is proctected, the cells the user inputs information into are unlocked.
Currently I have the following coding:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 18 Then
Cells(Target.Row, 1).Select
End If
End Sub

What this does is if the user tabs out of column 18, row 3 for example, the
cursor goes to column A in the same row.

The above coding works only if there is a numeric value in the cell in
column 18. How can I get the above coding to work if the user leaves the
cell blank?

Thanks.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tabbing within a cell leahl Excel Discussion (Misc queries) 4 July 3rd 09 04:33 PM
How do i change the color of a cell when tabbing? Lisa Z Excel Worksheet Functions 2 December 18th 08 02:51 PM
Tabbing to a specific cell eddie57[_4_] Excel Worksheet Functions 3 November 14th 07 02:54 AM
Tabbing to the next cell katlane Excel Worksheet Functions 2 February 1st 06 05:45 PM
Tabbing/Indenting within a cell DianeMcP New Users to Excel 2 July 19th 05 05:33 PM


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"