LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Need Code For Selection

here is some code i use to set the print area

Range("A1").select
ActiveWorkbook.Names.Add Name:="Top50Rpt", RefersTo:= _
Range(Range("A1"),Range("A1").Offset(49,15))
ActiveSheet.PageSetup.PrintArea = "Top50Rpt"

You might have to change the code a little to something
like:
RefersTo:=Range(Range("A1"),Range("A1").end(xldown )_
..end(xltoright)

-----Original Message-----
Hello
I hope someone will help me to solve my problem.
I have the data from column A to G (from H.. everything

is blank) and I
keep adding data below it. Is there any way I can run a

macro to select
the print area by finding the last row? Eg: if I have

data in 16 rows
and when I run the macro it should select the range A1-

G16 and set the
print area. Row 17 will have no data in it.
Hope it is clear.
Thanks in Advance
Regds
Toms


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

.

 
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
cell selection code NDBC Excel Discussion (Misc queries) 6 August 11th 09 06:39 AM
Selection code sixfivebeastman Excel Programming 3 May 27th 04 08:54 PM
Code is dragging selection when should copy rglasunow[_16_] Excel Programming 1 February 3rd 04 04:41 PM
Range selection code in a macro Floss Excel Programming 1 December 30th 03 01:05 AM
Print Selection in Code Donna Brooks Excel Programming 2 July 25th 03 04:35 PM


All times are GMT +1. The time now is 05:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"