Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default 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.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default 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


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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




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
Limit data entry in range of cells JStiehl Excel Worksheet Functions 2 June 25th 09 12:08 PM
Detect strings in a range Rich57 Excel Worksheet Functions 4 January 1st 08 12:00 AM
Detect non-blank range Connie Excel Discussion (Misc queries) 2 October 16th 06 08:36 PM
limit text entry in a range of cells QTPRM Excel Discussion (Misc queries) 2 May 25th 05 03:52 AM
Data Entry in a cell still in progress - how to detect and correct Paul Willman Excel Programming 0 June 29th 04 10:25 PM


All times are GMT +1. The time now is 09:27 PM.

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"