Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Print only columns (or ranges) that have at least one currency val

In my worksheet, I would always like to print Columns A-F and only the
individual columns in G-R that have at least one value (formatted as
Currency). If a given column between G and R has just the text heading in
rows 1 or 2 OR is blank (though preformatted for Currency), then I want to
suppress printing that particular column.

- I don't want to have to select the columns but would rather use VBA to
check whether Currency values exist in a column ornamed range

- I want whichever columns that meet the criterion to print as one
continuous range

Can anyone help?

Thanks, cspowell100
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Print only columns (or ranges) that have at least one currency val

Maybe something like.....

Sub PrintCurrencyColumns()
For j = 7 to 18
bHide = True
For i = 1 to 2 '(or 1 to
Cells.SpecialCells(xlCellTypeLastCell).Row)
If IsNumeric(Cells(i,j).Text) = False Then bHide = False
Next i
If bHide = True Then Columns(j).Hidden = True
Next j
'code for printing here, don't remember offhand, but the
'macro recorder might help, maybe ActiveSheet.Print?
Columns.Hidden = False
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Print only columns (or ranges) that have at least one currency

Dave - This goes a long way toward solving theproblem, I'll tinker with it
and see how it goes...

Thanks, cspowell100

"Dave B" wrote:

Maybe something like.....

Sub PrintCurrencyColumns()
For j = 7 to 18
bHide = True
For i = 1 to 2 '(or 1 to
Cells.SpecialCells(xlCellTypeLastCell).Row)
If IsNumeric(Cells(i,j).Text) = False Then bHide = False
Next i
If bHide = True Then Columns(j).Hidden = True
Next j
'code for printing here, don't remember offhand, but the
'macro recorder might help, maybe ActiveSheet.Print?
Columns.Hidden = False
End Sub


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
COMBINING TWO COLUMNS THAT ARE CURRENCY Donna[_2_] Excel Worksheet Functions 2 August 24th 09 11:08 PM
Print Area ranges print on separate pages? Lyndon Excel Discussion (Misc queries) 1 December 29th 06 05:22 PM
Adding currency broken in two columns? lperisich Excel Worksheet Functions 1 August 4th 05 03:19 PM
Print Ranges Alan Excel Programming 3 August 31st 03 10:47 AM


All times are GMT +1. The time now is 08:37 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"