Hi All
So i need a macro that locates the bold data that come right after each other from a column ("D")
then combines them in the cell next to them in column "C" and it keeps doing it for the next set of bold data that come right after each other
here is what it should do
before:
C D
acura
rdx
4 wheels
toyota
corolla
4 wheels
2000 HD diesel
calibre
van
4 wheels
after:
C D
acura rdx acura
acura rdx rdx
acura rdx 4 wheels
toyota corolla toyota
toyota corolla corolla
toyota corolla 4 wheels
toyota corolla 2000 hd diesel
calibre van calibre
calibre van van
calibre van 4 wheels
so basically it has to concatenate only the bold data that is relevant for each non-bold data...so here the first relevant data for the "4 wheels" is acura rdx
when it reaches the blank rows it stops...
goes to the next set of data...concatenates the bold data again which is toyota corolla and pastes it next to the unbold data "4-wheels" and "2000 hd diesel"
and again for the calibre van
right now I have this code working (thanks to SkipVought)
however it is taking ALL the bold data and putting them together in the cells in column C...and i need it to pick up only the ones relevant to each group
i already have a macro that will clear the rows which won't be necessary... like
acura rdx acura
acura rdx rdx
toyota corolla toyota
toyota corolla corolla
calibre van calibre
calibre van van
thanks in advance for your help
So i need a macro that locates the bold data that come right after each other from a column ("D")
then combines them in the cell next to them in column "C" and it keeps doing it for the next set of bold data that come right after each other
here is what it should do
before:
C D
acura
rdx
4 wheels
toyota
corolla
4 wheels
2000 HD diesel
calibre
van
4 wheels
after:
C D
acura rdx acura
acura rdx rdx
acura rdx 4 wheels
toyota corolla toyota
toyota corolla corolla
toyota corolla 4 wheels
toyota corolla 2000 hd diesel
calibre van calibre
calibre van van
calibre van 4 wheels
so basically it has to concatenate only the bold data that is relevant for each non-bold data...so here the first relevant data for the "4 wheels" is acura rdx
when it reaches the blank rows it stops...
goes to the next set of data...concatenates the bold data again which is toyota corolla and pastes it next to the unbold data "4-wheels" and "2000 hd diesel"
and again for the calibre van
right now I have this code working (thanks to SkipVought)
Code:
Sub test()
Dim rng As Range, r As Range, sOUT As String
Set rng = Intersect(Cells(12, "D").EntireColumn, ActiveSheet.UsedRange)
For Each r In rng
With r
If .Font.Bold Then
sOUT = sOUT & .Value & " "
End If
End With
Next
sOUT = Left(sOUT, Len(sOUT) - 1)
For Each r In rng
With r
If .Font.Bold Then
With .Offset(0, -1)
.Value = sOUT
.Font.Bold = True
End With
End If
End With
Next
Set rng = Nothing
End Sub
however it is taking ALL the bold data and putting them together in the cells in column C...and i need it to pick up only the ones relevant to each group
i already have a macro that will clear the rows which won't be necessary... like
acura rdx acura
acura rdx rdx
toyota corolla toyota
toyota corolla corolla
calibre van calibre
calibre van van
thanks in advance for your help