Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have the following macro, but I would like to run only when a "w" is
entered in any cell in column A. Private Sub Worksheet_Change(ByVal Target As Range) If ActiveCell.Value = "w" Then Range("I" & ActiveCell.Row).Select End If End Sub Thanks in advance for the help!!! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In your Sheet module enter
Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Range("A:A"), Target) Is Nothing Then If Target.Value = "w" Then Range("I" & Target.Row).Select End If End If End Sub "davemon" wrote: I have the following macro, but I would like to run only when a "w" is entered in any cell in column A. Private Sub Worksheet_Change(ByVal Target As Range) If ActiveCell.Value = "w" Then Range("I" & ActiveCell.Row).Select End If End Sub Thanks in advance for the help!!! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks again......... Works Great!!!!!!!!!!!
|
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You need to change your if to the following condition:
If ActiveCell.Value = "w" And ActiveCell.Column = 1 Then but you will have to turn MOVE SELECTION AFTER ENTER to off by clicking TOOLS/OPTIONS, clicking the EDIT tab and turning off the checkbox. -- Kevin Backmann "davemon" wrote: I have the following macro, but I would like to run only when a "w" is entered in any cell in column A. Private Sub Worksheet_Change(ByVal Target As Range) If ActiveCell.Value = "w" Then Range("I" & ActiveCell.Row).Select End If End Sub Thanks in advance for the help!!! |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
if target.cells.count 1 then exit sub 'only one cell at a time if intersect(target,me.range("a:a")) is nothing then exit sub if lcase(target.value) = "w" then me.cells(target.row,"I").select end if end sub davemon wrote: I have the following macro, but I would like to run only when a "w" is entered in any cell in column A. Private Sub Worksheet_Change(ByVal Target As Range) If ActiveCell.Value = "w" Then Range("I" & ActiveCell.Row).Select End If End Sub Thanks in advance for the help!!! -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A On Error GoTo enditall Application.EnableEvents = False If Target.Cells.Column = 1 Then n = Target.Row If Excel.Range("A" & n).Value = "w" Then Range("I" & n).Select End If End If enditall: Application.EnableEvents = True End Sub Gord Dibben MS Excel MVP On Thu, 21 Sep 2006 08:26:02 -0700, davemon wrote: I have the following macro, but I would like to run only when a "w" is entered in any cell in column A. Private Sub Worksheet_Change(ByVal Target As Range) If ActiveCell.Value = "w" Then Range("I" & ActiveCell.Row).Select End If End Sub Thanks in advance for the help!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to find text string in a column and paste data in another | Excel Discussion (Misc queries) | |||
Return SEARCHED Column Number of Numeric Label and Value | Excel Worksheet Functions | |||
creating a bar graph | Excel Discussion (Misc queries) | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions | |||
Return Count for LAST NonBlank Cell in each Row | Excel Worksheet Functions |