Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I need a warning to appear when a user enter a value into A1, if there is a
value in any cell in the range B1:T1 Any one got a solution? Thanks Pat |
#2
![]() |
|||
|
|||
![]()
Hi Pat,
One way Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False With Target If .Address = "$A$1" Then If Application.CountA(Range("B1:T1")) 0 Then MsgBox "Data in B1:T1" End If End If End With ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH RP (remove nothere from the email address if mailing direct) "Pat" wrote in message ... I need a warning to appear when a user enter a value into A1, if there is a value in any cell in the range B1:T1 Any one got a solution? Thanks Pat |
#3
![]() |
|||
|
|||
![]()
Try this:
Goto cell A1. Select menu: Data Validation... Tab: Settings Allow: Custom Formula: =COUNT(B1:T1)=0 Tab: Error Alert Title: Error Values present in B1:T1 Done! Ola Sandstrom |
#4
![]() |
|||
|
|||
![]()
Hi Pat
you can code a worksheet_change even to check to see if there is anything in B1:T1 when data is entered in A1 - e.g. ---- Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" And Target.Value < "" Then If Application.WorksheetFunction.CountIf(Sheets("Shee t3").Range("B1:T1"), "*") = 1 Then MsgBox "Range B1:T1 is not empty" End If End If End Sub --- to use the code, right mouse click on the sheet that you want to run the code against and choose view code copy & paste the above directly into the right hand side screen - if you get any red lines, click at the end of the line and press the delete key - this should fix up any line break problems. change "Sheet3" to the name of your sheet use alt & f11 to switch back to your worksheet and test Hope this helps Cheers JulieD "Pat" wrote in message ... I need a warning to appear when a user enter a value into A1, if there is a value in any cell in the range B1:T1 Any one got a solution? Thanks Pat |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pulling data from 1 sheet to another | Excel Worksheet Functions | |||
How can I check if data in an external data range is changed afte. | Excel Worksheet Functions | |||
How can I check if data in external data range is changed after re | Excel Discussion (Misc queries) | |||
how do I make a formula NOT change when the data range is moved? | Excel Discussion (Misc queries) | |||
Can you average data in 1 column based on a range of values in another? | Excel Worksheet Functions |