Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default WorkSheet Selecteion Chage Event to prompt Input Box

I am trying to set a few cells within a sheet to trigger an InputBox.

If one of the set cells value is = 'Sheet5.range("B46") then the
..Offset(0,1).value = the InputBox value.

I am having trouble getting the InputBox to show when the cell value = the
Sheet5 value???

Corey.....


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default WorkSheet Selecteion Chage Event to prompt Input Box

In your Sheet5 module (rt-click sheet tab, View code)

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rCell As Range
Const sAddr As String = "$B$46"

Set rCell = Range(sAddr)

On Error GoTo errH

If Not Intersect(Target, rCell) Is Nothing Then
reTry:
res = Application.InputBox("Enter value for cell C46", _
rCell.Address(0, 0) & " has just
changed")
If CStr(res) = CStr(False) Then

If MsgBox("you cancelled, try again ?", vbYesNo) = vbYes Then
Err.Raise 22222
End If

Else
rCell.Offset(, 1).Value = res
End If
End If

cleanUp:
' reset any changed application settings
Exit Sub
errH:
If Err.Number = 22222 Then
Resume reTry
Else
Resume cleanUp
End If
End Sub

Regards,
Peter T


"Corey" wrote in message
...
I am trying to set a few cells within a sheet to trigger an InputBox.

If one of the set cells value is = 'Sheet5.range("B46") then the
.Offset(0,1).value = the InputBox value.

I am having trouble getting the InputBox to show when the cell value = the
Sheet5 value???

Corey.....



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
Prompt user for input Jerry Foley Excel Programming 2 April 13th 07 08:46 PM
Prompt user for input and utilize that input ninner Excel Worksheet Functions 2 March 28th 07 09:44 PM
Having a Macro Prompt Me For Input carl Excel Worksheet Functions 3 January 13th 06 02:24 PM
prompt for input while macro running mmcintire Excel Programming 3 January 27th 04 02:57 PM


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