converting alternate row in coloumn

livinggourmand

New Member
Joined
Aug 6, 2011
Messages
21
I have a vocabulary list,but word& meaning is in 1 row and sentence example in row below
i want it to be side by side as shown in image.
Kindly help
excel.jpg
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Does definition #4's example really occupy two rows as shown (as opposed to being in a single cell with wrapped text)?

Are all your words always going to be single words (as opposed to two-word entries like "scarlet fever")?
 
Upvote 0
@Rick Rothstein
sorry for late reply

yes, few definitions occupy more rows (thats a close inspections... thanks)
and all words always going to be single words
 
Upvote 0
Give this macro a try...
Code:
Sub RearrangeWordsDefinitionsAndExamples()
  Dim X As Long, LastRow As Long, Definition As String, A As Range, Data() As String
  LastRow = Cells(Rows.Count, "A").End(xlUp).Row
  With Range("B1").Resize(LastRow)
    .FormulaR1C1 = "=IF(ISNUMBER(--LEFT(RC[-1])),SUBSTITUTE(MID(RC[-1],FIND("" "",RC[-1])+1,999),"" "",CHAR(1),1),"""")"
    .Value = .Value
    For Each A In .SpecialCells(xlCellTypeBlanks).Areas
      If A.Rows.Count > 1 Then
        Definition = Join(WorksheetFunction.Transpose(A.Offset(, -1)))
      Else
        Definition = A.Offset(, -1).Value
      End If
      A(1).Offset(-1).Value = A(1).Offset(-1).Value & Chr(1) & Definition
    Next
    .SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    .TextToColumns Range("B1"), xlDelimited, , , False, False, False, False, True, Chr(1)
  End With
  Columns("A").Delete
  Rows(1).Insert
  With Range("A1:C1")
    .Value = Array("Word", "Meaning", "Sentence Example")
    .Interior.ColorIndex = 6
    .EntireColumn.Columns.AutoFit
  End With
End Sub
 
Last edited:
Upvote 0
@Rick Rothstein

hey it worked!!!!!!!!!!!!!!!!!!!!!
i appreciate ur quick response with perfect solution

Thanks a lot.

ok if possible can u explain ur macro to me.
i kno thats way too much bt it ll help me understand macros

thanks again
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top