IfMacroPrintSheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need a little help with a If Function-print: I have written a Macro like
the one shown below but when I activate the Macro, This section of the Macro
is bypassed
and I do not have the printout that I need.

Range("B30").Select
Worksheets("Green").Calculate
Range("B6").Select
If Selection = "good" Then
Sheets("red").Select
Range("A8:J38").Select
Selection.PrintOut Copies:=1, Collate:=True
Sheets("green").Select
Range("B2").Select
End If

I appreciate any help that someone can offer.
mike
 
With sheet green active

If Range("B6").Value = "good" Then
Sheets("red").Range("A8:J38").PrintOut Copies:=1, Collate:=True
Range("B2").Select
End If
 
Ron
Thanks for the help but I still unable to receive the prinout. I know that the
Macro is working since their is a section after this that copies some info
into
another sheet and this section works.
I have duplicated the spacing indicated and the exact wording but still
nothing.
Must the sheet names be in lower case to work?
Mike
 
Hi Mike

I have test it myself and it is working for me.
if you have "Good" in b6 it is not working

If you only run this macro with the sheet "green active is it
working then?.

Sub test()
If Range("B6").Value = "good" Then
Sheets("Red").Range("A8:J38").PrintOut Copies:=1, Collate:=True
Range("B2").Select
End If
End Sub
No if the sheet is named "Red" or "red" it is both working
 
Ron
Still not working, below is the current If-Print section of the Macro.
Still unable to obtain printout.

Range("B30").Select
Sheets("green").Calculate
Sheets("green").Select
Range("B6").Select
If Range("B6").Value = "good" Then
Sheets("red").Range("A8:J81").PrintOut Copies:=1, Collate:=True
Sheets("green").Select
Range("B2").Select
End If
 
Hi mike

If you run only this macro with the sheet "green" active
Is it working then

Sub test()
If Range("B6").Value = "good" Then
Sheets("Red").Range("A8:J38").PrintOut Copies:=1
Range("B2").Select
End If
End Sub
 
Back
Top