![]() |
How Do I Detect An Entry In A Range Of Cells
Greetings,
I am trying to use a CommandButton called "NEXT" to trigger an event. If there was any data entered into any one of 50 cells (a named range called "CustInfo"), I need a CommandButton called "Save Info" to become visible and the "NEXT" button to become invisible. If there is no data entered into "CustInfo", Then I only need the "NEXT" button to become invisible (the "Save Info" button is already invisible). I know how to turn the CommandButtons on and off. I just don't know how to detect if anything was entered into any of the cells in the "CustInfo" named range. Anyone have any ideas? Any help would be appreciated. TIA -Minitman |
How Do I Detect An Entry In A Range Of Cells
Minitman
one way would be to use: Private Sub Worksheet_Change(ByVal Target As Range) End Sub Check the help and the NewsGroup(s) for examples of Worksheet_Change ... you'll find dozens and I'm sure that there will be one similar to your requirement. You'll need something like: Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("CustInfo")) Is Nothing Then Exit Sub MsgBox "your code here ..." End Sub Regards Trevor "Minitman" wrote in message ... Greetings, I am trying to use a CommandButton called "NEXT" to trigger an event. If there was any data entered into any one of 50 cells (a named range called "CustInfo"), I need a CommandButton called "Save Info" to become visible and the "NEXT" button to become invisible. If there is no data entered into "CustInfo", Then I only need the "NEXT" button to become invisible (the "Save Info" button is already invisible). I know how to turn the CommandButtons on and off. I just don't know how to detect if anything was entered into any of the cells in the "CustInfo" named range. Anyone have any ideas? Any help would be appreciated. TIA -Minitman |
How Do I Detect An Entry In A Range Of Cells
Hey Trevor,
Thanks for the reply, however, I am already using Private Sub Worksheet_Change(ByVal Target As Range) with another sub and VBE won't let me do more then one. The first one is to force certain cells to be all uppercase Is there any other way to do either of these tasks? Again, TIA. -Minitman On Sat, 2 Oct 2004 12:05:07 +0100, "Trevor Shuttleworth" wrote: Minitman one way would be to use: Private Sub Worksheet_Change(ByVal Target As Range) End Sub Check the help and the NewsGroup(s) for examples of Worksheet_Change ... you'll find dozens and I'm sure that there will be one similar to your requirement. You'll need something like: Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("CustInfo")) Is Nothing Then Exit Sub MsgBox "your code here ..." End Sub Regards Trevor "Minitman" wrote in message .. . Greetings, I am trying to use a CommandButton called "NEXT" to trigger an event. If there was any data entered into any one of 50 cells (a named range called "CustInfo"), I need a CommandButton called "Save Info" to become visible and the "NEXT" button to become invisible. If there is no data entered into "CustInfo", Then I only need the "NEXT" button to become invisible (the "Save Info" button is already invisible). I know how to turn the CommandButtons on and off. I just don't know how to detect if anything was entered into any of the cells in the "CustInfo" named range. Anyone have any ideas? Any help would be appreciated. TIA -Minitman |
How Do I Detect An Entry In A Range Of Cells
Your have to combine the current Event with the one Trevor provided. What code do you currently have in that Event now -- Ivan F Moal ----------------------------------------------------------------------- Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195 View this thread: http://www.excelforum.com/showthread.php?threadid=26569 |
How Do I Detect An Entry In A Range Of Cells
Hey Ivan,
Thanks for the assistance. What I have in that event at this time is this: Private Sub Worksheet_Change(ByVal Target As Range) 'Force Caps on certain ranges On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range("AK15:AM22,B32,X2,Q7,Q10")) Is_ Nothing Then With Target .Value = UCase(.Value) End With End If ws_exit: Application.EnableEvents = True End Sub How can they be combined? -Minitman On Sun, 3 Oct 2004 01:09:45 -0500, Ivan F Moala wrote: Your have to combine the current Event with the one Trevor provided. What code do you currently have in that Event now. |
How Do I Detect An Entry In A Range Of Cells
Greetings,
I sent this over the weekend and realized that I forgot an important bit of information. I do not need any thing to happen at the time I change the information in this named range, I need the fact that a change has been made so that the act of clicking on the "NEXT" button will make the "NEXT" button not visible and will make the two "SAVE" buttons visible (Save as NEW record and Save changes to current record). Trevor and Ivan suggested using the Private Sub Worksheet_Change(ByVal Target As Range) event, but I can't see how to tie it into the "NEXT" button Any ideas on how to accomplish this? TIA -Minitman On Sat, 02 Oct 2004 03:13:44 -0500, Minitman wrote: Greetings, I am trying to use a CommandButton called "NEXT" to trigger an event. If there was any data entered into any one of 50 cells (a named range called "CustInfo"), I need a CommandButton called "Save Info" to become visible and the "NEXT" button to become invisible. If there is no data entered into "CustInfo", Then I only need the "NEXT" button to become invisible (the "Save Info" button is already invisible). I know how to turn the CommandButtons on and off. I just don't know how to detect if anything was entered into any of the cells in the "CustInfo" named range. Anyone have any ideas? Any help would be appreciated. TIA -Minitman |
How Do I Detect An Entry In A Range Of Cells
1st check if there is a value, then change the properties of your buttons,
make sure to precede the buttons names by the name of the Form they're on: Private Sub Worksheet_Change(ByVal Target As Range) with target if .value < "" then With FormName 'replace FormName with the actual name of the Form the buttons are on .next.visible=False .saveNewRec.visible = True 'or saveNewRec.enabled = True if the button is already visible but was disabled .saveChanges.visible = True End With end if end with end sub hope that helps "Minitman" wrote in message ... Greetings, I sent this over the weekend and realized that I forgot an important bit of information. I do not need any thing to happen at the time I change the information in this named range, I need the fact that a change has been made so that the act of clicking on the "NEXT" button will make the "NEXT" button not visible and will make the two "SAVE" buttons visible (Save as NEW record and Save changes to current record). Trevor and Ivan suggested using the Private Sub Worksheet_Change(ByVal Target As Range) event, but I can't see how to tie it into the "NEXT" button Any ideas on how to accomplish this? TIA -Minitman On Sat, 02 Oct 2004 03:13:44 -0500, Minitman wrote: Greetings, I am trying to use a CommandButton called "NEXT" to trigger an event. If there was any data entered into any one of 50 cells (a named range called "CustInfo"), I need a CommandButton called "Save Info" to become visible and the "NEXT" button to become invisible. If there is no data entered into "CustInfo", Then I only need the "NEXT" button to become invisible (the "Save Info" button is already invisible). I know how to turn the CommandButtons on and off. I just don't know how to detect if anything was entered into any of the cells in the "CustInfo" named range. Anyone have any ideas? Any help would be appreciated. TIA -Minitman |
All times are GMT +1. The time now is 08:25 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com