ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   String problem. (https://www.excelbanter.com/excel-programming/313758-string-problem.html)

Mannyluk

String problem.
 
Hi,

I have some worksheets that have the following type of data.

****DATA***** ****DATA***** ****DATA***** ****DATA*****
****DATA***** ****DATA***** ****DATA***** ****DATA*****
****DATA***** ****DATA***** ****DATA***** ****DATA*****
The required data in each string can be found by counting from the
left....or it can be found by testing for the second full stop in the string.
Each worksheet has a different number of rows. I need to take the DATA out
of each cell on the same row and concatenate it and move it to the next
worksheet, then move to the next row and repeat, and form a column of data in
the second worksheet.

any help would be great!!
Thanks in advance

Manny

Tom Ogilvy

String problem.
 
cnt is the count of the first character in the original string you want in
your result string. You want everything from the point to the right

Sub CopyData()
Dim cnt as Long, rw as long
Dim cell as Range, sStr as String, sStr1 as String
rw = 1
cnt = 9
for each cell in Selection
sStr = cell.Text
sStr1 =right(sStr,len(sStr)-(cnt-1))
Worksheets(2).Cells(rw,1).Value = sStr1
rw = rw + 1
Next
End Sub

--
Regards,
Tom Ogilvy



"Mannyluk" wrote in message
...
Hi,

I have some worksheets that have the following type of data.

****DATA***** ****DATA***** ****DATA***** ****DATA*****
****DATA***** ****DATA***** ****DATA***** ****DATA*****
****DATA***** ****DATA***** ****DATA***** ****DATA*****
The required data in each string can be found by counting from the
left....or it can be found by testing for the second full stop in the

string.
Each worksheet has a different number of rows. I need to take the DATA out
of each cell on the same row and concatenate it and move it to the next
worksheet, then move to the next row and repeat, and form a column of data

in
the second worksheet.

any help would be great!!
Thanks in advance

Manny





All times are GMT +1. The time now is 07:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com