View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
loric loric is offline
external usenet poster
 
Posts: 1
Default Selecting Used Range


I have the following code I am trying to edit:

Public Sub SelectData()

Workbooks(CurName).Activate
Range("A1").Activate

ActiveSheet.UsedRange.Select
rowscount = Selection.Rows.Count

Set CopyArea = Range("A1", ("L" & rowscount))

CopyArea.Select
Get_Col_Widths

End Sub

There are some hidden columns to the right of L that contain data. Th
data goes all the way to row 149. In Excel if I look for the last ro
it goes to 149, so does this code. For instance A:L might only have 4
rows. I want to just select those 45 rows and not the rows with hidde
data in them. Otherwise I get additional pages with no data in them
Can this be done? I there a way in the Slection.Rows.Count to limit i
to look in just columns A-L

--
lori
-----------------------------------------------------------------------
loric's Profile: http://www.excelforum.com/member.php...fo&userid=3392
View this thread: http://www.excelforum.com/showthread.php?threadid=53698