View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Selecting range of cells to copy using a variable

I still can't determine what you want. As I said, send a wb with a clear
explanation and before/after examples.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
...
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