LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default apply cell change event to single column - WorksheetChange Event

dumbest question that will be posted all day, but here goes anyway.
How do I change the following macro so that it only applies to one
column instead of two? I don't know how to properly modify
Range(Cells(Target.Row, 15), Cells(Target.Row, 16)) to just one of
those columns. Deleting the second "range" gives me a run-time
error. Maybe I should be using something all together different
anyway. When the user enters a value into Column 14, I want the word
"Subfile" to appear in Column 15; however, if the user deletes the
text in Column 14, I want "Subfile" removed/deleted.

Any and all help is always appreciated.

Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

If Target.Column = 14 And Target.Value < "" Then
Range(Cells(Target.Row, 15), Cells(Target.Row, 16)).Value =
"Subfile"
End If

If Target.Column = 14 And Target.Value = "" Then
Range(Cells(Target.Row, 15), Cells(Target.Row, 16)).Value = ""
End If

Application.EnableEvents = True
End Sub
 
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
How do I change a Worksheet_change event to a beforesave event? Tueanker Excel Programming 5 June 29th 07 03:00 PM
Change event on single cell fires many times XP Excel Programming 3 November 6th 06 10:16 PM
Worksheet change event-single column jasminesy Excel Programming 2 July 17th 06 06:27 PM
MsgBox in Enter event causes combobox not to run Change event Richard Excel Programming 0 March 6th 06 02:52 PM
How to trap delete row event and hide column event? Alan Excel Programming 3 April 26th 05 04:25 PM


All times are GMT +1. The time now is 02:09 AM.

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

About Us

"It's about Microsoft Excel"