Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to copy a range of cells but the size of the range may change.
I will be using a variable to determine the size of the table. How can I select a range with this variable to copy and paste the range of cells. Frank |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
examples
-- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ... I need to copy a range of cells but the size of the range may change. I will be using a variable to determine the size of the table. How can I select a range with this variable to copy and paste the range of cells. Frank |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 24, 8:08*pm, "Don Guillett" wrote:
examples -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ... I need to copy a range of cells but the size of the range may change. I will be using a variable to determine the size of the table. How can I select a range with this variable to copy and paste the range of cells. Frank- Hide quoted text - - Show quoted text - I'm still lost. I'm trying to get something like RANGE(A1:B4).Select, but I don't have a predefined range and need to use variables. Eg. RANGE(Start:End).Select Can anyone help. Frank |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
lr=cells(rows.count,"a").end(xlup).row
RANGE("A1:B"&lr).copy'NO need to select -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ... On Jan 24, 8:08 pm, "Don Guillett" wrote: examples -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ... I need to copy a range of cells but the size of the range may change. I will be using a variable to determine the size of the table. How can I select a range with this variable to copy and paste the range of cells. Frank- Hide quoted text - - Show quoted text - I'm still lost. I'm trying to get something like RANGE(A1:B4).Select, but I don't have a predefined range and need to use variables. Eg. RANGE(Start:End).Select Can anyone help. Frank |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 25, 8:08*am, "Don Guillett" wrote:
lr=cells(rows.count,"a").end(xlup).row RANGE("A1:B"&lr).copy'NO need to select -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ... On Jan 24, 8:08 pm, "Don Guillett" wrote: examples -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ... I need to copy a range of cells but the size of the range may change. I will be using a variable to determine the size of the table. How can I select a range with this variable to copy and paste the range of cells. Frank- Hide quoted text - - Show quoted text - I'm still lost. *I'm trying to get something like RANGE(A1:B4).Select, but I don't have a predefined range and need to use variables. Eg. RANGE(Start:End).Select Can anyone help. Frank- Hide quoted text - - Show quoted text - I don't know the start cell, because it can change as well. I need to control both the start and end cell using a variable. Can you show how this is possible? Frank |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If Start is A1 and End is C2, here are different ways to do it.
Range(Range("A1"), Range("C2")).Select Range(Cells(1, "A"), Cells(2, "C")).Select Range(Cells(1, 1), Cells(2, 3)).Select Range("A1").Resize(2, 3).Select Range(Range("Start"),Range("End")).Select -- Tim Zych SF, CA ------------------ I'm still lost. I'm trying to get something like RANGE(A1:B4).Select, but I don't have a predefined range and need to use variables. Eg. RANGE(Start:End).Select Can anyone help. Frank |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 25, 6:31*pm, "Don Guillett" wrote:
If desired, send me a workbook with your examples and snippets of these emails. -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ... On Jan 25, 8:08 am, "Don Guillett" wrote: lr=cells(rows.count,"a").end(xlup).row RANGE("A1:B"&lr).copy'NO need to select -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ... On Jan 24, 8:08 pm, "Don Guillett" wrote: examples -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message .... I need to copy a range of cells but the size of the range may change. I will be using a variable to determine the size of the table. How can I select a range with this variable to copy and paste the range of cells. Frank- Hide quoted text - - Show quoted text - I'm still lost. I'm trying to get something like RANGE(A1:B4).Select, but I don't have a predefined range and need to use variables. Eg. RANGE(Start:End).Select Can anyone help. Frank- Hide quoted text - - Show quoted text - I don't know the start cell, because it can change as well. I need to control both the start and end cell using a variable. *Can you show how this is possible? Frank- Hide quoted text - - Show quoted text - TableSize = TableSize + 1 Do While Cells(TableSize, 1) < "" TableSize = TableSize + 1 Loop Range("A1:K" &TableSize).Select Selection.Copy Cells(TableSize*2+5,1).select ActiveSheet.Paste Range("C &TableSize*2+5:C" &TableSize*2+6).Select Application.CutCopyMode = False Selection.Merge Above is an example. I start with a loop to determine the size of the table. Then I make a copy of this table. Next, I need to select two cells to merge them together. I don't know the absolute value of these cells. How can I accomplish this? Frank |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 25, 6:48*pm, "Tim Zych" <tzych@NOSp@mE@RTHLINKDOTNET wrote:
If Start is A1 and End is C2, here are different ways to do it. Range(Range("A1"), Range("C2")).Select Range(Cells(1, "A"), Cells(2, "C")).Select Range(Cells(1, 1), Cells(2, 3)).Select Range("A1").Resize(2, 3).Select Range(Range("Start"),Range("End")).Select -- Tim Zych SF, CA ------------------ I'm still lost. *I'm trying to get something like RANGE(A1:B4).Select, but I don't have a predefined range and need to use variables. Eg. RANGE(Start:End).Select Can anyone help. Frank- Hide quoted text - - Show quoted text - Thanks Tim. That helps. Frank |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting a Range with a Variable in VB | Excel Programming | |||
Selecting a variable range | Excel Programming | |||
Copy only Visible Cells of a Variable Range... | Excel Programming | |||
selecting range of cells - variable # of rows | Excel Programming | |||
Selecting a variable range | Excel Programming |