ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dynamically adding data after the last column (https://www.excelbanter.com/excel-programming/375325-dynamically-adding-data-after-last-column.html)

Barb Reinhardt

Dynamically adding data after the last column
 
I want to do the following

Set a dynamic range name of USED Range
First row is row 30
First column is column A
Last column is the last column of data in row 30.
Last row is the last row of data in the last column.

Once that named range is defned, I want to copy the data in the last column
of data over one column.

AND ... I want to do this all programmatically or with a predefined range
name.

Can someone assist?

Thanks

Charles Chickering

Dynamically adding data after the last column
 
Dim R As Range
Set R = Range("A30", Range("A30").End(xlToRight).End(xlDown))
--
Charles Chickering

"A good example is twice the value of good advice."


"Barb Reinhardt" wrote:

I want to do the following

Set a dynamic range name of USED Range
First row is row 30
First column is column A
Last column is the last column of data in row 30.
Last row is the last row of data in the last column.

Once that named range is defned, I want to copy the data in the last column
of data over one column.

AND ... I want to do this all programmatically or with a predefined range
name.

Can someone assist?

Thanks


Barb Reinhardt

Dynamically adding data after the last column
 
That answered the first part of my question. What do I need to do to copy
the data over one column from the last column?

"Charles Chickering" wrote:

Dim R As Range
Set R = Range("A30", Range("A30").End(xlToRight).End(xlDown))
--
Charles Chickering

"A good example is twice the value of good advice."


"Barb Reinhardt" wrote:

I want to do the following

Set a dynamic range name of USED Range
First row is row 30
First column is column A
Last column is the last column of data in row 30.
Last row is the last row of data in the last column.

Once that named range is defned, I want to copy the data in the last column
of data over one column.

AND ... I want to do this all programmatically or with a predefined range
name.

Can someone assist?

Thanks


Barb Reinhardt

Dynamically adding data after the last column
 
Thanks. That answered part of it. What I really want to do is select the
range of cells that is one cell immediately to the right of this range. How
do I do that?


"Charles Chickering" wrote:

Dim R As Range
Set R = Range("A30", Range("A30").End(xlToRight).End(xlDown))
--
Charles Chickering

"A good example is twice the value of good advice."


"Barb Reinhardt" wrote:

I want to do the following

Set a dynamic range name of USED Range
First row is row 30
First column is column A
Last column is the last column of data in row 30.
Last row is the last row of data in the last column.

Once that named range is defned, I want to copy the data in the last column
of data over one column.

AND ... I want to do this all programmatically or with a predefined range
name.

Can someone assist?

Thanks


Charles Chickering

Dynamically adding data after the last column
 
Sry, Missed that.
Dim R As Range
Set R = Range("A30", Range("A30").End(xlToRight).End(xlDown))
Range(R.Cells(1, R.Columns.Count), R.Cells(R.Rows.Count, _
R.Columns.Count)).Copy R.Cells(1, R.Columns.Count).Offset(, 1)
--
Charles Chickering

"A good example is twice the value of good advice."


"Barb Reinhardt" wrote:

That answered the first part of my question. What do I need to do to copy
the data over one column from the last column?

"Charles Chickering" wrote:

Dim R As Range
Set R = Range("A30", Range("A30").End(xlToRight).End(xlDown))
--
Charles Chickering

"A good example is twice the value of good advice."


"Barb Reinhardt" wrote:

I want to do the following

Set a dynamic range name of USED Range
First row is row 30
First column is column A
Last column is the last column of data in row 30.
Last row is the last row of data in the last column.

Once that named range is defned, I want to copy the data in the last column
of data over one column.

AND ... I want to do this all programmatically or with a predefined range
name.

Can someone assist?

Thanks



All times are GMT +1. The time now is 01:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com