Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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?



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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?



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Excel Programming 2 May 25th 04 06:59 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"