Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Repeat entries in rows 5 & 6 into next blank column
Hi,
I have headings in rows 5&6 which I would like repeated in the next blank column or columns to the right. Each heading needs to be repeated until nth column which has data. The macro should start looking for data to repeat from column "E" onwards and autofill say column "F" rows 5 & 6 if blank. Thank |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Repeat entries in rows 5 & 6 into next blank column
I am not sure you want AutoFill. Try this first:
Sub ExpndHdng() lstc = ActiveSheet.Cells(7, Columns.Count).End(xlToLeft).Column Range("$E$5:$E$6").Copy Range(Cells(5, 5), Cells(6, lstc)) End Sub If this does not do what you want, then post back with more detail. "manfareed" wrote: Hi, I have headings in rows 5&6 which I would like repeated in the next blank column or columns to the right. Each heading needs to be repeated until nth column which has data. The macro should start looking for data to repeat from column "E" onwards and autofill say column "F" rows 5 & 6 if blank. Thank |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Repeat entries in rows 5 & 6 into next blank column
manfareed,
I think this is what your asking for. Sub Manfreed() Dim LastCell As String 'look for the last data value Range("e7").Select Selection.End(xlToRight).Select ActiveCell.Offset(0, 0).Select LastCell = ActiveCell.Offset(-1, 0).Address LastCell = Replace(LastCell, "$", "") LastCell = "E5:" & LastCell & "" 'Copy and paste it Range("E5:E6").Select Selection.Copy Range(LastCell).Select ActiveSheet.Paste Application.CutCopyMode = False 'Return to E5 Range("E5").Select End Sub "manfareed" wrote: Hi, I have headings in rows 5&6 which I would like repeated in the next blank column or columns to the right. Each heading needs to be repeated until nth column which has data. The macro should start looking for data to repeat from column "E" onwards and autofill say column "F" rows 5 & 6 if blank. Thank |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Repeat entries in rows 5 & 6 into next blank column
JLGWhiz,
This is a lot easier than my suggestion! "JLGWhiz" wrote: I am not sure you want AutoFill. Try this first: Sub ExpndHdng() lstc = ActiveSheet.Cells(7, Columns.Count).End(xlToLeft).Column Range("$E$5:$E$6").Copy Range(Cells(5, 5), Cells(6, lstc)) End Sub If this does not do what you want, then post back with more detail. "manfareed" wrote: Hi, I have headings in rows 5&6 which I would like repeated in the next blank column or columns to the right. Each heading needs to be repeated until nth column which has data. The macro should start looking for data to repeat from column "E" onwards and autofill say column "F" rows 5 & 6 if blank. Thank |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Repeat entries in rows 5 & 6 into next blank column
Hi,
The first heading needs only to be repeated until the next column is reached with data. For example from column E as the start point. If "E" has data and then next column with data is "K" . The data from "E" should only populate up to column "I" and so on. After column "K" blank rows 5&6 should be populated by data in column "K". Thanks, "manfareed" wrote: Hi, I have headings in rows 5&6 which I would like repeated in the next blank column or columns to the right. Each heading needs to be repeated until nth column which has data. The macro should start looking for data to repeat from column "E" onwards and autofill say column "F" rows 5 & 6 if blank. Thank |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Repeat entries in rows 5 & 6 into next blank column
manfareed,
So is there a headings in column k and others? "manfareed" wrote: Hi, The first heading needs only to be repeated until the next column is reached with data. For example from column E as the start point. If "E" has data and then next column with data is "K" . The data from "E" should only populate up to column "I" and so on. After column "K" blank rows 5&6 should be populated by data in column "K". Thanks, "manfareed" wrote: Hi, I have headings in rows 5&6 which I would like repeated in the next blank column or columns to the right. Each heading needs to be repeated until nth column which has data. The macro should start looking for data to repeat from column "E" onwards and autofill say column "F" rows 5 & 6 if blank. Thank |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Repeat entries in rows 5 & 6 into next blank column
Hi,
Yes there are headings in other columns but in between there will be blank columns. Each time I run a report with different data the columns with headings also change. Thanks, Manir "JRForm" wrote: manfareed, So is there a headings in column k and others? "manfareed" wrote: Hi, The first heading needs only to be repeated until the next column is reached with data. For example from column E as the start point. If "E" has data and then next column with data is "K" . The data from "E" should only populate up to column "I" and so on. After column "K" blank rows 5&6 should be populated by data in column "K". Thanks, "manfareed" wrote: Hi, I have headings in rows 5&6 which I would like repeated in the next blank column or columns to the right. Each heading needs to be repeated until nth column which has data. The macro should start looking for data to repeat from column "E" onwards and autofill say column "F" rows 5 & 6 if blank. Thank |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Repeat entries in rows 5 & 6 into next blank column
Hi,
This is now ok ... Thanks, Manir "manfareed" wrote: Hi, I have headings in rows 5&6 which I would like repeated in the next blank column or columns to the right. Each heading needs to be repeated until nth column which has data. The macro should start looking for data to repeat from column "E" onwards and autofill say column "F" rows 5 & 6 if blank. Thank |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamically sized table compiled from unsorted rows with blank entries | Excel Worksheet Functions | |||
Use formula to remove blank entries from a column | Excel Worksheet Functions | |||
printing issue - want to repeat two rows and also 5 rows in column | Excel Discussion (Misc queries) | |||
How do I transpose entries that repeat in sequence down a column . | Excel Programming | |||
Excel VBA - Repeat for loop until blank rows | Excel Programming |