Help with creating new macro.

Q

Question_123

Hi group,
I have this CSV file. In this CSV file there are groups of related
information each group is 25 rows (4 rows in my example). I want to
create a new tab for each group with the 3 letter company number as
the tab title. I have tried a few things from other posts here.. but
I cannot get it to work, I think it can be done with macro but my
limited knowledge of excel im not sure if there is a better way to
accomplish this. Any help will be appreciated. Thanks.

AAA 20040401 20040430 AAA Company
0 0 TOTAL OPENING INVENTORY
0 0 PURCHASES
0 0 ADJUSTMENTS & ACCRUALS
BBB 20040401 20040430 BBB Company
0 0 TOTAL OPENING INVENTORY
0 0 PURCHASES
0 0 ADJUSTMENTS & ACCRUALS
CCC 20040401 20040430 CCC Company
0 0 TOTAL OPENING INVENTORY
0 0 PURCHASES
0 0 ADJUSTMENTS & ACCRUALS
 
D

David McRitchie

Doesn't line up for in proportional font or in fixed font, but I
think this is what your are looking for.

Replicate values into blank cells (#fill_empty)
http://www.mvps.org/dmcritchie/excel/fillhand.htm#fillempty

Has both nonprogramming and programming solutions. THe
programming solution will bold the original making it easier
to work with.

Sub Fill_Empty()
'--David McRitchie, 2003-07-24,
'--Macro version of -- Excel -- Data Entry -- Fill Blank Cells
'http://www.contextures.com/xlDataEntry02.html
'http://www.pcworld.com/shared/printable_articles/0,1440,9346,00.html
Dim oRng As Range
Set oRng = Selection
Selection.Font.Bold = True
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Font.Bold = False
Selection.FormulaR1C1 = "=R[-1]C"
oRng.Copy
oRng.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub
 
Q

Question_123

I am looking for an example of the kind of macro that will copy the
first 25 rows into tab one called AAA, the next 25 into tab two called
BBB etc. I seen a similar posting that does what I want but I could
not get it to work on my particular data.


David McRitchie said:
Doesn't line up for in proportional font or in fixed font, but I
think this is what your are looking for.

Replicate values into blank cells (#fill_empty)
http://www.mvps.org/dmcritchie/excel/fillhand.htm#fillempty

Has both nonprogramming and programming solutions. THe
programming solution will bold the original making it easier
to work with.

Sub Fill_Empty()
'--David McRitchie, 2003-07-24,
'--Macro version of -- Excel -- Data Entry -- Fill Blank Cells
'http://www.contextures.com/xlDataEntry02.html
'http://www.pcworld.com/shared/printable_articles/0,1440,9346,00.html
Dim oRng As Range
Set oRng = Selection
Selection.Font.Bold = True
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Font.Bold = False
Selection.FormulaR1C1 = "=R[-1]C"
oRng.Copy
oRng.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

Question_123 said:
Hi group,
I have this CSV file. In this CSV file there are groups of related
information each group is 25 rows (4 rows in my example). I want to
create a new tab for each group with the 3 letter company number as
the tab title. I have tried a few things from other posts here.. but
I cannot get it to work, I think it can be done with macro but my
limited knowledge of excel im not sure if there is a better way to
accomplish this. Any help will be appreciated. Thanks.

AAA 20040401 20040430 AAA Company
0 0 TOTAL OPENING INVENTORY
0 0 PURCHASES
0 0 ADJUSTMENTS & ACCRUALS
BBB 20040401 20040430 BBB Company
0 0 TOTAL OPENING INVENTORY
0 0 PURCHASES
0 0 ADJUSTMENTS & ACCRUALS
CCC 20040401 20040430 CCC Company
0 0 TOTAL OPENING INVENTORY
0 0 PURCHASES
0 0 ADJUSTMENTS & ACCRUALS
 
D

David McRitchie

Here is a rely by Dick Kusleika, 2003-12-08
Split large sheet into several smaller sheets for emailing
http://google.com/[email protected]

It spits on the basis of the data in first column changing, you can
change that to a number of rows. The macro includes the header line
row from the original when creating each sheet.

If you found something that seemed to almost work you could point
to that posting and say what it does and what it doesn't do that you
need rather than someone starting from scratch. Fortunately some-
thing was already out there that seems to be a pretty close match
to what you want. so hopefully no one has to write something for you
and you can modify to suit your requirements including what you
actually want to call your new worksheets.

The use of your real name in newsgroups would be a lot more friendly.
It not like we'd send you bill if we knew your name...
 
Q

Question_123

Thanks David for your assistance. Greatly appreciated. I am
completly out of my element in excel. I have your web pages
bookmarked for reference. Again Thank you.


David McRitchie said:
Here is a rely by Dick Kusleika, 2003-12-08
Split large sheet into several smaller sheets for emailing
http://google.com/[email protected]

It spits on the basis of the data in first column changing, you can
change that to a number of rows. The macro includes the header line
row from the original when creating each sheet.

If you found something that seemed to almost work you could point
to that posting and say what it does and what it doesn't do that you
need rather than someone starting from scratch. Fortunately some-
thing was already out there that seems to be a pretty close match
to what you want. so hopefully no one has to write something for you
and you can modify to suit your requirements including what you
actually want to call your new worksheets.

The use of your real name in newsgroups would be a lot more friendly.
It not like we'd send you bill if we knew your name...
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

Question_123 said:
I am looking for an example of the kind of macro that will copy the
first 25 rows into tab one called AAA, the next 25 into tab two called
BBB etc. I seen a similar posting that does what I want but I could
not get it to work on my particular data.
 
Top