Consulting

Results 1 to 3 of 3

Thread: Extract data from string to new sheet

  1. #1

    Extract data from string to new sheet

    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
    Attached Files Attached Files

  2. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    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

  3. #3
    Thank you that worked great!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •