just trying to copy 6 rows to the right

T

tbmarlie

I know this is a basic question, but I haven't used excel vb in years
so I'm trying to get some of the dust off.

I have the following vb code to copy a footer cell (which was used to
sum the contents of the column above it) and paste it to the 6 cells
to the right.
Range("E154").Select
Selection.Copy
Range("F154:L154").Select
ActiveSheet.Paste

I just want to make this a relative formula.

After a few of these, I'll start to get the swing of things again.
 
T

tbmarlie

I know this is a basic question, but I haven't used excel vb in years
so I'm trying to get some of the dust off.

I have the following vb code to copy a footer cell (which was used to
sum the contents of the column above it) and paste it to the 6 cells
to the right.
Range("E154").Select
    Selection.Copy
    Range("F154:L154").Select
    ActiveSheet.Paste

I just want to make this a relative formula.

After a few of these, I'll start to get the swing of things again.


I guess, before this, I need to figure out how to get to cell E154
which will also be changing because the number of rows will be
changing. If I start at Cell E3 and then put in code to get to the
very last cell (in this case, it just happens to be E154), I'm
assuming it would be something like the following:

Dim Rng As Range
Set Rng = Range("E3").End(xlDown)

But, once I have this range, I'm not sure of the code to actually get
me there using this range
 
T

tbmarlie

I guess, before this, I need to figure out how to get to cell E154
which will also be changing because the number of rows will be
changing.  If I start at Cell E3 and then put in code to get to the
very last cell (in this case, it just happens to be E154), I'm
assuming it would be something like the following:

Dim Rng As Range
    Set Rng = Range("E3").End(xlDown)

But, once I have this range, I'm not sure of the code to actually get
me there using this range

Oh, and the title of this s/b copying 6 cells to the right, not
copying 6 rows, sorry
 
D

Dave Peterson

Check your other post.

I know this is a basic question, but I haven't used excel vb in years
so I'm trying to get some of the dust off.

I have the following vb code to copy a footer cell (which was used to
sum the contents of the column above it) and paste it to the 6 cells
to the right.
Range("E154").Select
Selection.Copy
Range("F154:L154").Select
ActiveSheet.Paste

I just want to make this a relative formula.

After a few of these, I'll start to get the swing of things again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top