redspanna
Well-known Member
- Joined
- Jul 27, 2005
- Messages
- 1,602
- Office Version
- 365
- Platform
- Windows
Hi all,
I have this code..
It will look down column C and copy any text strings that are underlined and paste them into a separate sheet..
Example: if sheet1 column c holds following..
A
Simple
Test
Hope
It
Works
the code above will give result of:
A,Test
However, I would like it to be displayed in sheet2 like below..
A
Test
so separate line and without the , to separate
any help appreciated
I have this code..
Code:
Sub COPY_Text()
With Sheets("sheet1")
For MY_ROWS = 1 To 54
If .Range("C" & MY_ROWS).Font.Underline = xlUnderlineStyleSingle Then
MY_TEXT = MY_TEXT & .Range("C" & MY_ROWS).Value & ", "
End If
Next MY_ROWS
If MY_TEXT <> "" Then
Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(0, 6).Value = Left(MY_TEXT, Len(MY_TEXT) - 2)
MY_TEXT = ""
End If
End With
End Sub
It will look down column C and copy any text strings that are underlined and paste them into a separate sheet..
Example: if sheet1 column c holds following..
A
Simple
Test
Hope
It
Works
the code above will give result of:
A,Test
However, I would like it to be displayed in sheet2 like below..
A
Test
so separate line and without the , to separate
any help appreciated