ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Macro help (https://www.excelbanter.com/excel-programming/305412-excel-macro-help.html)

Josh[_11_]

Excel Macro help
 
I've exported data from one accounting software package into a
tab-delimited txt file that I can use in Excel. I'd like to format
the txt file in Excel so that it is in the proper format to be
imported into a different accounting software package.

I've gotten things to a point and now I need a macro that will insert
2 blank line between each row. I've been able to find a macro that
inserts 1 blank line, but I need two rows and I don't know how to read
the code.

Now I've got the records formatted with 1 line of data followed 2
blank rows inserted, I need the data in cells B,C, and F copied to the
first blank row and I need the data from column E cut and pasted into
the first blank row. There is an entirely blank row inbetween each
record.

A B C D F
B C E F
(blank row)

I need this macro to perform this modification on every record in the
worksheet, and I don't know how to write a loop within an Excel
macro.

Any help out there?

Bob Phillips[_6_]

Excel Macro help
 
Hi Josh,

Some

Sub ReOrganise()
Dim cRows As Long
Dim i As Long

cRows = Cells(Rows.Count, "A").End(xlUp).Row
For i = cRows To 1 Step -1
With Cells(i, "A")
.Offset(1, 0).Resize(2).EntireRow.Insert
.Offset(0, 1).Copy .Offset(1, 1)
.Offset(0, 2).Copy .Offset(1, 2)
.Offset(0, 4).Copy .Offset(1, 4)
.Offset(0, 5).Copy .Offset(1, 5)
.Offset(0, 4).Value = ""
End With
Next i
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Josh" wrote in message
om...
I've exported data from one accounting software package into a
tab-delimited txt file that I can use in Excel. I'd like to format
the txt file in Excel so that it is in the proper format to be
imported into a different accounting software package.

I've gotten things to a point and now I need a macro that will insert
2 blank line between each row. I've been able to find a macro that
inserts 1 blank line, but I need two rows and I don't know how to read
the code.

Now I've got the records formatted with 1 line of data followed 2
blank rows inserted, I need the data in cells B,C, and F copied to the
first blank row and I need the data from column E cut and pasted into
the first blank row. There is an entirely blank row inbetween each
record.

A B C D F
B C E F
(blank row)

I need this macro to perform this modification on every record in the
worksheet, and I don't know how to write a loop within an Excel
macro.

Any help out there?




Lori Jo Vincent

Excel Macro help
 
Thank you so much for putting this post out. This helped
me with a problem I was having.

I receive a very ugly TXT report file that isn't
formatted to be of any use. I used these instructions to
re-organize the data to columns to the right of the
existing data, re-sorted and pulled out what I was after.

-- L J


-----Original Message-----
Hi Josh,

Some

Sub ReOrganise()
Dim cRows As Long
Dim i As Long

cRows = Cells(Rows.Count, "A").End(xlUp).Row
For i = cRows To 1 Step -1
With Cells(i, "A")
.Offset(1, 0).Resize(2).EntireRow.Insert
.Offset(0, 1).Copy .Offset(1, 1)
.Offset(0, 2).Copy .Offset(1, 2)
.Offset(0, 4).Copy .Offset(1, 4)
.Offset(0, 5).Copy .Offset(1, 5)
.Offset(0, 4).Value = ""
End With
Next i
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Josh" wrote in message
. com...
I've exported data from one accounting software

package into a
tab-delimited txt file that I can use in Excel. I'd

like to format
the txt file in Excel so that it is in the proper

format to be
imported into a different accounting software package.

I've gotten things to a point and now I need a macro

that will insert
2 blank line between each row. I've been able to find

a macro that
inserts 1 blank line, but I need two rows and I don't

know how to read
the code.

Now I've got the records formatted with 1 line of data

followed 2
blank rows inserted, I need the data in cells B,C, and

F copied to the
first blank row and I need the data from column E cut

and pasted into
the first blank row. There is an entirely blank row

inbetween each
record.

A B C D F
B C E F
(blank row)

I need this macro to perform this modification on

every record in the
worksheet, and I don't know how to write a loop within

an Excel
macro.

Any help out there?



.


Bob Phillips[_6_]

Excel Macro help
 
Excellent, two in one<vbg

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Lori Jo Vincent" wrote in message
...
Thank you so much for putting this post out. This helped
me with a problem I was having.

I receive a very ugly TXT report file that isn't
formatted to be of any use. I used these instructions to
re-organize the data to columns to the right of the
existing data, re-sorted and pulled out what I was after.

-- L J


-----Original Message-----
Hi Josh,

Some

Sub ReOrganise()
Dim cRows As Long
Dim i As Long

cRows = Cells(Rows.Count, "A").End(xlUp).Row
For i = cRows To 1 Step -1
With Cells(i, "A")
.Offset(1, 0).Resize(2).EntireRow.Insert
.Offset(0, 1).Copy .Offset(1, 1)
.Offset(0, 2).Copy .Offset(1, 2)
.Offset(0, 4).Copy .Offset(1, 4)
.Offset(0, 5).Copy .Offset(1, 5)
.Offset(0, 4).Value = ""
End With
Next i
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Josh" wrote in message
. com...
I've exported data from one accounting software

package into a
tab-delimited txt file that I can use in Excel. I'd

like to format
the txt file in Excel so that it is in the proper

format to be
imported into a different accounting software package.

I've gotten things to a point and now I need a macro

that will insert
2 blank line between each row. I've been able to find

a macro that
inserts 1 blank line, but I need two rows and I don't

know how to read
the code.

Now I've got the records formatted with 1 line of data

followed 2
blank rows inserted, I need the data in cells B,C, and

F copied to the
first blank row and I need the data from column E cut

and pasted into
the first blank row. There is an entirely blank row

inbetween each
record.

A B C D F
B C E F
(blank row)

I need this macro to perform this modification on

every record in the
worksheet, and I don't know how to write a loop within

an Excel
macro.

Any help out there?



.





All times are GMT +1. The time now is 12:05 AM.

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