Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Resize
I have the used the following piece of code to resize a
range in my file. With Range(sRange) ..Offset(1, 5).Resize(.Rows.Count - 1, .Columns.Count - 5) _ ..Name = (sRange & "data") End With However, I'd like to use the above for something else and wondered if anyone could help with the settings. In the above example, resize is being used to reduce the area of my range, but what I'd like to is change the area. For example, sRange represents the area of columns A to F whereas I'd like it to represent columns G to U instead. There is also a header row in row 1. How would I need to adapt the above? and is Resize the correct property to use? Any help is appreciated. Many thanks Jacqui |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Resize
Offset shifts a range left or right or not at all and up or down or not at
all Resize changes the number of rows and columns defined by the range. You would have to define how to accomplish what you want. Your A to F and G to U is ambiguous as to what it refers to what needs to refer to. If you have a hard coded area, then just Range("G2:U10") -- Regards, Tom Ogilvy "jacqui" wrote in message ... I have the used the following piece of code to resize a range in my file. With Range(sRange) .Offset(1, 5).Resize(.Rows.Count - 1, .Columns.Count - 5) _ .Name = (sRange & "data") End With However, I'd like to use the above for something else and wondered if anyone could help with the settings. In the above example, resize is being used to reduce the area of my range, but what I'd like to is change the area. For example, sRange represents the area of columns A to F whereas I'd like it to represent columns G to U instead. There is also a header row in row 1. How would I need to adapt the above? and is Resize the correct property to use? Any help is appreciated. Many thanks Jacqui |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Resize
Also I tried to test your code with sRange="A1:F10", and it didn't work,
surprise, with the .Name statement. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Tom Ogilvy" wrote in message ... Offset shifts a range left or right or not at all and up or down or not at all Resize changes the number of rows and columns defined by the range. You would have to define how to accomplish what you want. Your A to F and G to U is ambiguous as to what it refers to what needs to refer to. If you have a hard coded area, then just Range("G2:U10") -- Regards, Tom Ogilvy "jacqui" wrote in message ... I have the used the following piece of code to resize a range in my file. With Range(sRange) .Offset(1, 5).Resize(.Rows.Count - 1, .Columns.Count - 5) _ .Name = (sRange & "data") End With However, I'd like to use the above for something else and wondered if anyone could help with the settings. In the above example, resize is being used to reduce the area of my range, but what I'd like to is change the area. For example, sRange represents the area of columns A to F whereas I'd like it to represent columns G to U instead. There is also a header row in row 1. How would I need to adapt the above? and is Resize the correct property to use? Any help is appreciated. Many thanks Jacqui |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I resize a range of cells in a column in excel? | Excel Discussion (Misc queries) | |||
I could NOT resize the axis title but excel allows me to resize gr | Charts and Charting in Excel | |||
Resize Range - Macro | Excel Worksheet Functions | |||
Range Resize property | Excel Programming | |||
Resize Range Problem | Excel Programming |