Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have a worksheet where the number of rows and columns vary each time I
process the data. I want to transpose the cols and rows but need to set the range before I copy. There may not be any data in the XY cell. Is there a way to do this in a macro? Thanks for any help. -- Al |
#2
![]() |
|||
|
|||
![]()
Hi Al,
Assume data starts in A1 and that there is a blank row below, and a blank column to the right, of the data, then your data can be defined by: ActiveSheet.Range("A1").CurrentRegion --- Regards, Norman "AMK" wrote in message ... I have a worksheet where the number of rows and columns vary each time I process the data. I want to transpose the cols and rows but need to set the range before I copy. There may not be any data in the XY cell. Is there a way to do this in a macro? Thanks for any help. -- Al |
#3
![]() |
|||
|
|||
![]()
LastRow = Cells(Cells.Rows.Count, 1).End(xlUp).Row
LastCol = Cells(1, 256).End(xlToLeft) -- Message posted via http://www.officekb.com |
#4
![]() |
|||
|
|||
![]()
or being consistent
LastCol = Cells(1, Columns.Count).End(xlToLeft).Column -- HTH Bob Phillips ""VoG via OfficeKB.com"" wrote in message ... LastRow = Cells(Cells.Rows.Count, 1).End(xlUp).Row LastCol = Cells(1, 256).End(xlToLeft) -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions | |||
Print range macro | Excel Discussion (Misc queries) | |||
automatic macro update | Excel Worksheet Functions | |||
How do I set a date range for conditional formatting in a macro? | Excel Worksheet Functions | |||
empty variable range | Excel Discussion (Misc queries) |