Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting a specific cell (that is data validated)


Okay, sorry, I'll try to explain my problem better. The following is my
code currently.


Code:
--------------------
Private Sub Worksheet_Activate()
'
'
Dim A As Variant
Dim B As Variant
Dim C As Variant
Dim D As Variant
'
Range("D8").Select
A = ActiveCell.Value
Range("C33").Select
C = ActiveCell.Value
'
Sheets("Revenue").Select
Range("D8").Select
B = ActiveCell.Value
Range("C33").Select
D = ActiveCell.Value
'
'
If A < B Or C < D Then
MsgBox "Please make sure that the currency choice and percentage of attendance are uniform for all sheets before viewing this page. Thank you."
End If
'
'
End Sub

--------------------


The ranges selected are cells that when you click on them, they drop
down a list of choices (data validation set to the list option), so I'm
trying to get the code to read what exact value it's on at the moment,
but when I step through the code, I get an error saying: Run-time error '1004': Application-defined or object-defined error. So I changed my variables to variant to cover everything, but still
the problem. When I do the direct A = Range("D8"), A doesn't pick up
anything and is set at "nothing"

I hope this is clearer,
Cami


--
cliodne
------------------------------------------------------------------------
cliodne's Profile: http://www.excelforum.com/member.php...o&userid=28774
View this thread: http://www.excelforum.com/showthread...hreadid=534873

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Selecting a specific cell (that is data validated)

Private Sub Worksheet_Activate()
'
If Range("D8").Value < Worksheets("Revenue").Range("D8").Value or _
Range("C33").Value < Worksheets("Revenue").Range("C33").Value _
Then
MsgBox "Please make sure that the currency choice and percentage of
attendance are uniform for all sheets before viewing this page. Thank you."
End If
'
'
End Sub


--
Regards,
Tom Ogilvy


"cliodne" wrote in
message ...

Okay, sorry, I'll try to explain my problem better. The following is my
code currently.


Code:
--------------------
Private Sub Worksheet_Activate()
'
'
Dim A As Variant
Dim B As Variant
Dim C As Variant
Dim D As Variant
'
Range("D8").Select
A = ActiveCell.Value
Range("C33").Select
C = ActiveCell.Value
'
Sheets("Revenue").Select
Range("D8").Select
B = ActiveCell.Value
Range("C33").Select
D = ActiveCell.Value
'
'
If A < B Or C < D Then
MsgBox "Please make sure that the currency choice and percentage of

attendance are uniform for all sheets before viewing this page. Thank you."
End If
'
'
End Sub

--------------------


The ranges selected are cells that when you click on them, they drop
down a list of choices (data validation set to the list option), so I'm
trying to get the code to read what exact value it's on at the moment,
but when I step through the code, I get an error saying: Run-time error

'1004': Application-defined or object-defined error. So I changed my
variables to variant to cover everything, but still
the problem. When I do the direct A = Range("D8"), A doesn't pick up
anything and is set at "nothing"

I hope this is clearer,
Cami


--
cliodne
------------------------------------------------------------------------
cliodne's Profile:

http://www.excelforum.com/member.php...o&userid=28774
View this thread: http://www.excelforum.com/showthread...hreadid=534873



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting a specific cell (that is data validated)


Thank you Tom. I must remember that format - works like a charm,

Cami


--
cliodne
------------------------------------------------------------------------
cliodne's Profile: http://www.excelforum.com/member.php...o&userid=28774
View this thread: http://www.excelforum.com/showthread...hreadid=534873

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
Selecting data from a specific column Charp Excel Discussion (Misc queries) 1 December 8th 09 05:29 PM
Data Validated Cell Arrow not Appearing Varne Excel Discussion (Misc queries) 9 January 2nd 08 05:51 PM
cell data not validated if navigating cell to cell with mouse LoveThatMouse Excel Worksheet Functions 6 May 21st 06 09:03 PM
Selecting Specific Data within a Table Huge Peanuts Excel Worksheet Functions 0 February 21st 06 04:09 PM
be validated or not validated in a cell x taol Excel Programming 1 November 22nd 05 01:36 AM


All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"