Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88868

Split Cell On Criteria

$
0
0

I have a complicated split I need to do in VBA excel. I want to split each piece that starts "C:", includes "OCAK" and ends ".JPG" in range("C1") into A1,A2,A3... when click the button.

FROM THIS enter image description here

TO THIS enter image description here

I'm still doing research and testing, but I can't find a real viable solution. Any ideas would be greatly appreciated.

Private Sub buton_Click()

If Cells(1, "c").Text Like "C:*OCAK*.jpg*" Then
   Dim jpgStart As Long
   jpgStart = InStr(Cells(1, "c").Text, ".jpg")
   Dim result As String
   result = Left(Cells(1, "c").Text, jpgStart - 1)
   Cells(1, "c").Offset(0, -2).Value = result
Else
   Cells(1, "c").Offset(0, -2).Value = vbNullString
End If
End Sub

Viewing all articles
Browse latest Browse all 88868

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>