I have an Excel sheet attached where I have a column called "Numbers"
The next column called "Button" needs a VBA code where it does the following: Remove ABC from the "Numbers" and in case of a -1 or -2 also remove this + add the number 100.
So ABC123456 becomes 100123456 and ABC123456-1 also becomes 100123456
I did manage to get a VBA output in the column "Button" where it just removes ABC using something
Sub removechar()
Dim input1 As String
Dim result As String
input1 = "aabbccAABBCC"
'to remove all occurrences of b from input string
result = Replace(input1, "b", "")
MsgBox result
End Sub
But I struggle to create one meeting all 3 requirements.
Once this output in the column "Button" has been established I want to use this same cell for the following function (button)
Option Explicit
Private fso As Object
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
End If
End Sub
But on cell activation it needs to open the URL google.com but with the "Button" cell added after a /
So on cell activation it needs to open the following URL: google.com/100123456
Bookmarks