+ Reply to Thread
Results 1 to 7 of 7

Deleting Content of a Cell till the End of Right (Not Row)

Hybrid View

  1. #1
    Registered User
    Join Date
    11-08-2009
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Deleting Content of a Cell till the End of Right (Not Row)

    Still unable to get it right. Any help would be good.

  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: Deleting Content of a Cell till the End of Right (Not Row)

    Try this:
    Sub DeleteColumns()
        Dim rFind       As Range
        Dim wks         As Worksheet
    
        For Each wks In ActiveWorkbook.Worksheets
            With wks
                Set rFind = .UsedRange.Find(What:="recvtiming", _
                                            LookIn:=xlValues, _
                                            LookAt:=xlWhole, _
                                            MatchCase:=False)
                Do Until rFind Is Nothing
                    .Range(rFind, .Cells(rFind.Row, .Columns.Count)).ClearContents
                    Set rFind = .UsedRange.FindNext(rFind)
                Loop
            End With
        Next wks
    End Sub
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    11-08-2009
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Deleting Content of a Cell till the End of Right (Not Row)

    SHG,

    It worked perfectly.

    Could you advice where it failed earlier.Its for my own learning.

    I will find way to close this thread as solved.

    rgds
    Saravanan K

  4. #4
    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: Deleting Content of a Cell till the End of Right (Not Row)

    Could you advice where it failed earlier.
    This is an invalid construct:
    FoundIt(1, LastCol - FoundIt.Column).ClearContents
    I will find way to close this thread as solved.
    For that and other useful information, see the forum rules.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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