LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben
 
Posts: n/a
Default Macro Inside Cell

Drop the Sub CellChange()

Drop the last double quote. Good practice also to stick in an error trap to
re-enable events if an error occurs.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$B$25" Then
On Error GoTo CleanUp
Application.EnableEvents = False
Target.Value = InputBox("Please enter an Order Number", "Order Number ")
End If
CleanUp:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Mon, 23 Jan 2006 13:40:21 -0600, dah
wrote:


This appears to be what would work but I get an error message (compile)
that Sub Cellchange() is wrong.


Sub CellChange()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$B$25" Then
Target.Value = InputBox("Please enter an Order Number", "Order
Number")
End If

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
run a macro in a locked cell Ray Excel Discussion (Misc queries) 8 January 10th 06 12:02 AM
Keyboard Macro Just Copies Content of Previous Cell Andy Excel Discussion (Misc queries) 1 October 24th 05 11:54 PM
Macro help - copy a cell down gjcase Excel Discussion (Misc queries) 3 September 4th 05 05:09 AM
move to another cell within a subtotal report within a macro NoelH Excel Worksheet Functions 1 August 31st 05 03:02 PM
macro help thephoenix12 Excel Discussion (Misc queries) 4 July 15th 05 05:57 PM


All times are GMT +1. The time now is 03:35 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"