Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That actually works great except that there is more an 1 column in the
worksheet that needs to be printed. I need all the columns in that row. Column P is my last column on that sheet. "JLGWhiz" wrote: This will set your print area for the visible values of column A only. If you want more columns to print, it will require modification. It will adjust according to only the cells that show values. Sub prtArea() Dim lr As Long, bRng As String lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row For i = lr To 1 Step -1 If Cells(i, 1) < "" Then bRng = Cells(i, 1).Address Exit For End If Next ActiveSheet.PageSetup.PrintArea = "A1:" & bRng End Sub "hshayhorn" wrote: I have a repeating IF statement running down column A for 200 rows. I'm making an assumption that I will not need more than 200 rows ever but I have no idea how many rows I may need. My issue is thta because of the 200 rows being used by the formula when I print the worksheet it prints all 200 rows now just the rows that have real data. If there a way besides having the user set the print area to only print rows with real data?? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formuals | Excel Discussion (Misc queries) | |||
New to Formuals | Excel Worksheet Functions | |||
Coding if formuals | Excel Programming | |||
Need to place 3 formuals in VBA | Excel Programming | |||
IF, Then formuals | Excel Programming |