ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple Macro? (https://www.excelbanter.com/excel-programming/369161-simple-macro.html)

[email protected][_2_]

Simple Macro?
 
I can't seem to do a standard Print IF when the IF references a formula
(Probably because I need something a little more complitcated?) Let's
say (Sheet2)A1= (Sheet1)A1, (Sheet1)A1=Bob. I know I can just call a
macro to Print Sheet 2 if (Sheet1)A1=Bob, but can I Print
If(Sheet2)A1=Bob? I don't really know how to write it out if this
doesn't make any sense, but when I reference a cell containing a
formula, I cant reference the value of the formula (Wether It's Bob,
Joe, Sue, etc...), that or I just don't know how......... (<----Most
Likely...)

Thanks for the help!


Excelenator[_27_]

Simple Macro?
 

Put this code in the Sheet2 section of the VBE. IF your formula is
Sheet2!'A1 = Sheet1!'A1, Anytime you change the value of Sheet1!A1 to
Bob or BOB or boB Sheet2 will print.



Code:
--------------------
Private Sub Worksheet_Calculate()
If UCase(Range("A1").Value) = "BOB" Then
Worksheets("Sheet2").PrintOut
End If
End Sub
--------------------




Wrote:
I can't seem to do a standard Print IF when the IF references a formula
(Probably because I need something a little more complitcated?) Let's
say (Sheet2)A1= (Sheet1)A1, (Sheet1)A1=Bob. I know I can just call a
macro to Print Sheet 2 if (Sheet1)A1=Bob, but can I Print
If(Sheet2)A1=Bob? I don't really know how to write it out if this
doesn't make any sense, but when I reference a cell containing a
formula, I cant reference the value of the formula (Wether It's Bob,
Joe, Sue, etc...), that or I just don't know how......... (<----Most
Likely...)

Thanks for the help!



--
Excelenator


------------------------------------------------------------------------
Excelenator's Profile:
http://www.excelforum.com/member.php...o&userid=36768
View this thread: http://www.excelforum.com/showthread...hreadid=567568



All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com