Results 1 to 10 of 10

Removing and Adding Characters from Strings in VBA + add and open this to a Sharepoint URL

Threaded View

  1. #1
    Registered User
    Join Date
    05-19-2021
    Location
    Netherlands
    MS-Off Ver
    Version 2104
    Posts
    33

    Question Removing and Adding Characters from Strings in VBA + add and open this to a Sharepoint URL

    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
    Attached Files Attached Files
    Last edited by Nebucanezars; 10-27-2022 at 07:45 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Adding and Removing Characters in a Cell
    By Dr.Acula in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-27-2022, 10:22 PM
  2. Filepath on SharePoint drive - more than 256 characters allowed
    By lb_33 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2022, 08:53 AM
  3. Removing Quotes from Strings
    By muddbog in forum Excel General
    Replies: 4
    Last Post: 05-23-2014, 03:28 AM
  4. [SOLVED] Adding characters to raw data text strings
    By nighthalcyon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-07-2013, 10:02 AM
  5. Removing Duplicates and adding special characters
    By dawsonsoo in forum Excel General
    Replies: 7
    Last Post: 10-12-2011, 02:49 PM
  6. Help with removing certain strings from cells
    By sparkroms in forum Excel General
    Replies: 2
    Last Post: 07-25-2006, 01:20 AM
  7. characters and strings
    By elicamacho in forum Excel General
    Replies: 4
    Last Post: 03-20-2006, 02:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1