Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Unfortunately, my Excel VBA Programming skills are weak. I need help in
creating a loop to merge rows by column. I have a spreadsheet that loads a text file for any numbers of rows. I need to reserve rows 1-4 for column heading information. the column spread is "a" - "FG". Can someone give me a shell to work with? Thank you |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub MergeHeaders()
Dim rng As Range, rCol As Range Set rng = Range("A1:FG4") rng.MergeCells = False For Each rCol In rng.Columns rCol.Merge Next End Sub if you don't want any warnings about loosing data in cells about to be merged start with Application.displayalerts = false and reset same to true when done. Instead of merging why not select the row-1, adjust height to that of 4 rows and format wrap text. Regards, Peter T "Helmut" wrote in message ... Unfortunately, my Excel VBA Programming skills are weak. I need help in creating a loop to merge rows by column. I have a spreadsheet that loads a text file for any numbers of rows. I need to reserve rows 1-4 for column heading information. the column spread is "a" - "FG". Can someone give me a shell to work with? Thank you |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter;
Thank you I'll give a try as well as your alternative suggestion. Time well spent. Helmut "Peter T" wrote: Sub MergeHeaders() Dim rng As Range, rCol As Range Set rng = Range("A1:FG4") rng.MergeCells = False For Each rCol In rng.Columns rCol.Merge Next End Sub if you don't want any warnings about loosing data in cells about to be merged start with Application.displayalerts = false and reset same to true when done. Instead of merging why not select the row-1, adjust height to that of 4 rows and format wrap text. Regards, Peter T "Helmut" wrote in message ... Unfortunately, my Excel VBA Programming skills are weak. I need help in creating a loop to merge rows by column. I have a spreadsheet that loads a text file for any numbers of rows. I need to reserve rows 1-4 for column heading information. the column spread is "a" - "FG". Can someone give me a shell to work with? Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I create a loop to merge rows... | Excel Programming | |||
How to create copy & paste loop--rows to new sheets | Excel Programming | |||
loop thru column and highlight the rows | Excel Discussion (Misc queries) | |||
Merge rows depending on the value of the first column | Excel Programming | |||
How do I merge column contents | Excel Discussion (Misc queries) |