here is my code, explanation below:
Select Case cells(1,1).value
Case "125/240"
Part_Number = "125"
Case "100/380"
Part_Number = "100"
Case "80/250"
Part_Number = "080"
Case "63/125"
Part_Number = "063"
' hundreds of other cases are written below
end select
I need a more efficent way of getting the part number. cells(1,1) is a cell where the system inputs a catalogue number for a certain unit. The part number is the number before the "/". I need to extract the part number from cell(1,1). I also need to add the zeroes for example 63/125 would be "065" and 80/250 would be "080"
So i need an argument that's something like this:
Get the number before the "/" inside the string and label it as the Part_Number.
Let X be the number of digits after "/"
Let Y be the number of digits before "/"
X-Y = number of Zeroes to add before the part number
Is VBA capable of doing this? It seems impossible =\...
Bookmarks