Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-16-2022, 05:43 AM
gmayor's Avatar
gmayor gmayor is offline Text removal Windows 10 Text removal Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

They following, based on your example, will work.


Code:
Sub Macro1()
Dim oTable As Table
Dim i As Long
Dim oRng As Range
Dim sText As String
    Set oTable = Selection.Tables(1)
    With oTable
        For i = 1 To .Rows.Count
            Set oRng = .Rows(i).Cells(1).Range
            If InStr(1, oRng.Text, "/") > 0 Then
                sText = Split(oRng.Text, "/")(0)
                If Not sText = "Income" And IsNumeric(sText) = False Then
                    oRng.Text = Trim(Split(oRng.Text, "/")(1))
                End If
            End If
        Next i
    End With
    Set oTable = Nothing
    Set oRng = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
pst password removal darnero Outlook 1 Yesterday 10:06 PM
Removal of resource calendars? Snoboy Project 0 10-07-2020 12:28 PM
Text removal Removal first 7 typos Chetan Seebra Excel Programming 2 03-31-2015 12:57 PM
Text removal table removal syntax EAGLE SEU Word VBA 5 01-23-2015 10:57 AM
Text removal Field removal from template Phelony Word 1 10-18-2011 03:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft