1
   

Excel Macro Help

 
 
PeterL
 
Reply Tue 21 Oct, 2003 07:28 pm
Hi, I started exploring with Excel macros just a few weeks ago. I used to be a Lotus user. I tried to write a simple macro to check for zero validation errors in my spreadsheet before printing a range. I came close to succeeding, but no cigar. Here's my macro, what am I missing?

Any help would be greatly appreciated!

Sub Validation_Check()
If Validation_Count = 0 Then
Call Print_Range
Else
GoTo Message
End If
Message:
MsgBox "All validation checks must be cleared to zero."
End Sub

Note:Print_Range prints even when Validation_Count is not equal to zero,
and Message is displayed even when Validation_Count is equal to zero.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 550 • Replies: 6
No top replies

 
Butrflynet
 
  1  
Reply Tue 21 Oct, 2003 09:17 pm
How are you defining validation_check and validation_count and where in the macro are you telling it to locate the result of the validation?
0 Replies
 
Butrflynet
 
  1  
Reply Tue 21 Oct, 2003 09:21 pm
Btw, welcome to A2K. I'm an old Lotus user too. It's a little difficult switching the mindset from Lotus to Excel. Have you noticed the hints for Lotus users in the Excel Help? I found those valuable when trying to change all my long term Lotus habits to Excel.
0 Replies
 
PeterL
 
  1  
Reply Wed 22 Oct, 2003 06:54 am
Butrflynet wrote:
How are you defining validation_check and validation_count and where in the macro are you telling it to locate the result of the validation?


Thank you for interest. Validation_Check is merely the name of my macro.
Validation_Count is actually a range-name defining the result of all validation errors from a validation check table. Do I need to define the location of this range-name. If so, how?
In my spreadsheet Validation_Count is found in Sheet:(Validation) at cell reference:(G134) =SUM(G100!G133). If each validation line meets the condition of my formulae, the validation count for that line will equal 0, otherwise it will equal 1.
Hope this helps. Thanks.
0 Replies
 
jespah
 
  1  
Reply Wed 22 Oct, 2003 08:36 am
Yes, you'll need to define location, and include the spreadsheet name if it's different from where you want the results to be, e. g.

='Validation'!G134

Note, the name of the spreadsheet is enclosed within single quotes, followed by an exclamation point. Then add the cel reference and that should satisfy the cel definition requirement.
0 Replies
 
PeterL
 
  1  
Reply Thu 23 Oct, 2003 06:26 am
jespah wrote:
Yes, you'll need to define location, and include the spreadsheet name if it's different from where you want the results to be, e. g.

='Validation'!G134

Note, the name of the spreadsheet is enclosed within single quotes, followed by an exclamation point. Then add the cel reference and that should satisfy the cel definition requirement.


Worked like a charm. Thanks for pointing me in the right direction.
0 Replies
 
jespah
 
  1  
Reply Thu 23 Oct, 2003 06:55 am
My pleasure! Welcome to A2K!
0 Replies
 
 

Related Topics

Clone of Micosoft Office - Question by Advocate
Do You Turn Off Your Computer at Night? - Discussion by Phoenix32890
The "Death" of the Computer Mouse - Discussion by Phoenix32890
Windows 10... - Discussion by Region Philbis
Surface Pro 3: What do you think? - Question by neologist
Windows 8 tips thread - Discussion by Wilso
GOOGLE CHROME - Question by Setanta
.Net and Firefox... - Discussion by gungasnake
Hacking a computer and remote access - Discussion by trying2learn
 
  1. Forums
  2. » Excel Macro Help
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 06/23/2025 at 01:37:41