PDA

View Full Version : Extract data from string to new sheet



Fabian76
06-18-2019, 03:43 PM
Hi,

I have this challenge, hopefully someone can help me save some time.

Attached is an spreadsheet with Source and Target.

Please note that sheet source may have a lot of rows however only what I highlited in yellow is needed.

Thanks in advance

大灰狼1976
06-18-2019, 11:25 PM
Hi Fabian!

Sub test()
Dim arr(1 To 8), s$
If Split(Cells(4, 1))(1) = "8300" Then s = "South" Else If Split(Cells(4, 1))(1) = "8400" Then s = "North" Else s = ""
arr(1) = s
arr(2) = Cells(9, 1)
If InStr(Cells(17, 1), "87 80") Then s = "Super" Else If InStr(Cells(17, 1), "91 80") Then s = "V-Power" Else s = ""
arr(3) = s
arr(4) = Cells(12, 1)
arr(5) = Split(Cells(17, 1))(1)
arr(6) = Format(Cells(15, 1), "yyyy/m/d")
arr(8) = Split(Cells(1, 1))(1)
Sheets(2).Cells(Rows.Count, 2).End(3).Offset(1).Resize(, 8) = arr
End Sub


--Okami

Fabian76
06-19-2019, 07:27 AM
Thank you that worked great!