+ Reply to Thread
Results 1 to 5 of 5

Thread: Deleting Periods In a Row

  1. #1
    Registered User
    Join Date
    03-18-2010
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    15

    Question Deleting Periods In a Row

    Is there a macro that will automatically delete all of the periods that are present in the cells of a row?

  2. #2
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Deleting Periods In a Row

    This one was created with the macro recorder. I bet you yould learn to do that, too.

    
    Sub DeletePeriods()
    '
    ' Select cells and run macro
    '
          Selection.Replace What:=".", Replacement:="", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
            ReplaceFormat:=False
    End Sub

  3. #3
    Registered User
    Join Date
    03-18-2010
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Deleting Periods In a Row

    Sorry for the delayed response.

    Is there a way to program it to always complete the action in Row 1?

    Thanks!

  4. #4
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Deleting Periods In a Row

    maybe

    Sub DeletePeriodsInRow1()
          Range("1:1").Replace What:=".", Replacement:="", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
            ReplaceFormat:=False
    End Sub

  5. #5
    Forum Guru Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007
    Posts
    3,523

    Re: Deleting Periods In a Row

    Just a slight mod to teylyn's code to make it run a little more efficiently

    Sub DeletePeriodsInRow1()
    
        Application.ScreenUpdating = False
        
          Range("1:1").Replace What:=".", Replacement:="", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
            ReplaceFormat:=False
            
        Application.ScreenUpdating = True
        
    End Sub
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

+ 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.2.0