+ Reply to Thread
Results 1 to 3 of 3

How to do a Macro to Trim SSN

Hybrid View

  1. #1
    Registered User
    Join Date
    02-07-2007
    Posts
    4

    How to do a Macro to Trim SSN

    To avoid compromise of personal information, I would like get help to do a macro to remove the first five of social security number and leave only the last four. I appreciate any help.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to do a Macro to Trim SSN

    cell.value = right(cell.text, 4)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to do a Macro to Trim SSN

    For example, select the cells of interest, and the run this:

    Sub x()
        Dim cell As Range
        
        For Each cell In Selection
            cell.Value = Right(cell.Text, 4)
        Next cell
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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