A Friend of mine has been helping to develop a small excel file to control our stock of letters an numbers. Everything works with taking away the letters but it does not take away the numbers, also for some reason we have to enter the letters in uppercase for it to work. I would prefer it to be able to work in upper and lower case.
Any help really would be gratefully received.
This is also the code that has been used so far:
Sub Macro1()
- Dim RegNo As String, RegNoClean As String, RegNoLen As Integer
- ActiveSheet.Shapes("Rounded Rectangle 1").Select
- RegNo = Selection.Characters.Text
- RegNoClean = Replace(RegNo, " ", "")
- RegNoLen = Len(RegNoClean)
- Dim RegNoChar
- For i = 0 To RegNoLen
- RegNoChar = Left(RegNoClean, 1)
- Range("A2").Select
- rowNum = ActiveCell.Row
- colNum = ActiveCell.Column
- Set currCell = ActiveSheet.Cells(rowNum, colNum)
- Do While rowNum < 36
- If currCell.Value = RegNoChar Then
- currCell.Offset(0, 1).Value = currCell.Offset(0, 1).Value - 2
- Else
- End If
- rowNum = rowNum + 1
- Set currCell = ActiveSheet.Cells(rowNum, colNum)
- Loop
- RegNoClean = Mid(RegNoClean, 2)
- Next
- ActiveSheet.Shapes("Rounded Rectangle 1").Select
- Selection.Characters.Text = ""
- With Selection.Font
- .Name = "Calibri"
- .FontStyle = "Regular"
- .Size = 72
- .Strikethrough = False
- .Superscript = False
- .Subscript = False
- .OutlineFont = False
- .Shadow = False
- .Underline = xlUnderlineStyleNone
- .ColorIndex = 1
- End With
- Range("I7").Select
End Sub
Bookmarks