ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting a standard row through VBA (https://www.excelbanter.com/excel-programming/368438-inserting-standard-row-through-vba.html)

[email protected]

Inserting a standard row through VBA
 
Who is able to help?

I try to make a piece of VB-coding for copying and pasting lines, but I
cannot manage to hold the line-number in memory.

This is the case:
I try to copy-paste (insert) a line on the row of the active cell. This
lines that has to be copied is a standard line on a standard location.
It has to be this line because of some formulas involved.

So imagine that I have an active cell on row 19 and I have to insert
here. The line to be copied and pasted is on line 6.
I will have to save the row-number in a varianle, because I will have
to perform this action not only on the active sheet, but on some other
sheets as well. (The line to be copied is on the same row-number and
has to be inserted on the same row as on the first active sheet).

How can I (in VBA) record the row number (and only the number)?

In my example I mention row 19, but this could also be row 20, 15 or
96.

Thanks for the attention and reply for this problem.

Remco


excelent

Inserting a standard row through VBA
 
x=activecell.row



" skrev:

Who is able to help?

I try to make a piece of VB-coding for copying and pasting lines, but I
cannot manage to hold the line-number in memory.

This is the case:
I try to copy-paste (insert) a line on the row of the active cell. This
lines that has to be copied is a standard line on a standard location.
It has to be this line because of some formulas involved.

So imagine that I have an active cell on row 19 and I have to insert
here. The line to be copied and pasted is on line 6.
I will have to save the row-number in a varianle, because I will have
to perform this action not only on the active sheet, but on some other
sheets as well. (The line to be copied is on the same row-number and
has to be inserted on the same row as on the first active sheet).

How can I (in VBA) record the row number (and only the number)?

In my example I mention row 19, but this could also be row 20, 15 or
96.

Thanks for the attention and reply for this problem.

Remco



Remco[_6_]

Inserting a standard row through VBA
 
How such a simple solution is the answer to my problem.

Thanks excelent

excelent wrote:
x=activecell.row



" skrev:

Who is able to help?

I try to make a piece of VB-coding for copying and pasting lines, but I
cannot manage to hold the line-number in memory.

This is the case:
I try to copy-paste (insert) a line on the row of the active cell. This
lines that has to be copied is a standard line on a standard location.
It has to be this line because of some formulas involved.

So imagine that I have an active cell on row 19 and I have to insert
here. The line to be copied and pasted is on line 6.
I will have to save the row-number in a varianle, because I will have
to perform this action not only on the active sheet, but on some other
sheets as well. (The line to be copied is on the same row-number and
has to be inserted on the same row as on the first active sheet).

How can I (in VBA) record the row number (and only the number)?

In my example I mention row 19, but this could also be row 20, 15 or
96.

Thanks for the attention and reply for this problem.

Remco





All times are GMT +1. The time now is 08:58 PM.

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