For best understanding you need to practice with real data problem. From this point of view, I'm going to solve a String problem from real life experience.
Problem:
The problem is a raw data after downloading from data server, the SKU (Stock Keeping Unit) code wrongly encoded as "SKU-US-90/10/45". To make a SKU wise Stock Report you need to convert the SKU code to correct format like below image:
Solution:
The problems are:
Here is the result:
By this way practice with real data for better understanding.
|||| Please SUBSCRIBE our YouTube Channel ||||
https://www.youtube.com/channel/UCIWaA5KCwZzBGwtmGIOFjQw
Problem:
The problem is a raw data after downloading from data server, the SKU (Stock Keeping Unit) code wrongly encoded as "SKU-US-90/10/45". To make a SKU wise Stock Report you need to convert the SKU code to correct format like below image:
Image 1: RawData SKU and Corrected SKU
Solution:
The problems are:
- Converting US to USA
- "/" to ""
- "-" to ""
Sub CorSKU() Dim x As String Dim i As Integer For i = 2 To 8 x = Cells(i, 1).Value Cells(i, 3).Value = Replace(Replace(Replace(x, "US", "USA"), "/", ""), "-", "") Next i End Sub
Here is the result:
Image 2: Result got from VBA
By this way practice with real data for better understanding.
|||| Please SUBSCRIBE our YouTube Channel ||||
https://www.youtube.com/channel/UCIWaA5KCwZzBGwtmGIOFjQw