View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
robertmharrison robertmharrison is offline
external usenet poster
 
Posts: 6
Default Why does macro change print range?

Thanks for your reply. In this case the problem was even more stupid ... the
macro put the report title in a merged cell. The hide column included one
element of the merged cell so the macro hid all the columns included in the
merged report title cell. I demerged the cell and remerged it with the cell
in the column to be hidden omitted and it works!

The stupid thing is that if you do the same thing manually it works even if
the meged cell has an element from the column to be hidden!

Best regards

Rob Harrison

"keepITcool" wrote:



Excel has problems with the combination
of Hiding Columns and FitToPage.

HOWEVER:
instead of hiding a column set its width to 0.0001
and your layout s/b as expected.





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


robertmharrison wrote :

I am using Excel 2002 SP3 and have a spreadsheet with some columns I
do not want to print on the printout for my customers. If I manually
select the columns and hide them and then use Print all is fine ...
but when I record what I do in a macro the printout omits 4 columns
prior to the 3 that I hide and prints out a meaningless report. I
have looked at the code and it appears to hide the correct columns.

The only other thing I can think of is that I am using the 'Scale to
fit one page wide' to make the report fit ... the printout from the
macro looks like it could be at 100% scaling.

Help! what (if anything) am I doing wrong?