ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Duplicating Cell Information (https://www.excelbanter.com/excel-worksheet-functions/16998-duplicating-cell-information.html)

[email protected]

Duplicating Cell Information
 
I have a spreadsheet with a long list of information. I would like to
know if there is a easy way of inserting rows in between the
information and at the same time duplicating the previous cell
information into the new row. Something like this:

Current
A B C D
1 ID Name BE_No_Of_TX W_No_Of_TX
2 748 FinanceABC 56.00 102.00
3 4999 CashABC -658.00 -71.00
4 5026 ABCCash -7.00 0.00
5 5032 CashForABC -2272.00 -2056.00
6 5061 WorldABC -8.00 14.00
7 5065 FoxABC -380.00 -916.00

New
A B C D
1 ID Name BE_No_Of_TX W_No_Of_TX
2 748 FinanceABC 56.00 102.00
3 748 FinanceABC 56.00 102.00
4 4999 CashABC -658.00 -71.00
5 4999 CashABC -658.00 -71.00
6 5026 ABCCash -7.00 0.00
7 5026 ABCCash -7.00 0.00
8 5032 CashForABC -2272.00 -2056.00
9 5032 CashForABC -2272.00 -2056.00
10 5061 WorldABC -8.00 14.00
11 5061 WorldABC -8.00 14.00
12 5065 FoxABC -380.00 -916.00
13 5065 FoxABC -380.00 -916.00

I have various lists which I need to this with so I think somekind of
macro will do.

TIA

JK




Naomi

Again this is programming rather than functions...

Dim i,id as integer
i = 5 (the row where your values begin)
id=i (used for the id column)

Do until cells(i,1).value = ""
Rows(i).select
with selection
.Copy
.Insert Shift:=xlDown
end with
cells(i,1)=(i-id)+1
cells(i+1,1)=(i-id)+2
i = i+2
loop





" wrote:

I have a spreadsheet with a long list of information. I would like to
know if there is a easy way of inserting rows in between the
information and at the same time duplicating the previous cell
information into the new row. Something like this:

Current
A B C D
1 ID Name BE_No_Of_TX W_No_Of_TX
2 748 FinanceABC 56.00 102.00
3 4999 CashABC -658.00 -71.00
4 5026 ABCCash -7.00 0.00
5 5032 CashForABC -2272.00 -2056.00
6 5061 WorldABC -8.00 14.00
7 5065 FoxABC -380.00 -916.00

New
A B C D
1 ID Name BE_No_Of_TX W_No_Of_TX
2 748 FinanceABC 56.00 102.00
3 748 FinanceABC 56.00 102.00
4 4999 CashABC -658.00 -71.00
5 4999 CashABC -658.00 -71.00
6 5026 ABCCash -7.00 0.00
7 5026 ABCCash -7.00 0.00
8 5032 CashForABC -2272.00 -2056.00
9 5032 CashForABC -2272.00 -2056.00
10 5061 WorldABC -8.00 14.00
11 5061 WorldABC -8.00 14.00
12 5065 FoxABC -380.00 -916.00
13 5065 FoxABC -380.00 -916.00

I have various lists which I need to this with so I think somekind of
macro will do.

TIA

JK






All times are GMT +1. The time now is 05:45 PM.

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