View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Binzelli[_9_] Binzelli[_9_] is offline
external usenet poster
 
Posts: 1
Default SETTING PRINT AREA IN VBA

KeepITCool.... what's wrong with you mate ? Just trying to help
eachother here or not ?

Frankie asked Please give me some clues for setting a relative reference

The code does just that. Your example just prints the entire sheet, not
quite what Frankie asked.

And for your 4 ERRORS:

1. It will indeed NEVER print more than 4 columns

Thats right, it's an example, remember ! Frankie can use whatever Range
(rows and columns) he likes. The code gives - as Frankie asked - a clue
for setting a relative reference
2, it uses select where it needn't

Sure ! Learning all the time ! Next time I'll use:

Code:
--------------------
Lastrow = ActiveCell.SpecialCells(xlLastCell).Row
--------------------

3: it uses a lastrow variable which isn't needed eitherSo what do you suggest ?


Code:
--------------------
ActiveSheet.PageSetup.PrintArea = "A1:D" & ActiveCell.SpecialCells(xlLastCell).Row
--------------------
more easy and nice and compact, but as Frankie said he was new to Excel
VBA, I thought the step-by-step approach makes things a bit more easy
to understand.
4: it dims a row number as double????

Should have been "Long"

Anyway, hope your next reaction is a bit more friendly.

Beetje collegialiteit kan geen kwaad Jurgen !

Groeten uit Amsterdam


---
Message posted from http://www.ExcelForum.com/