Results 1 to 4 of 4

VBA Code vs Macro Recording code

Threaded View

  1. #1
    Registered User
    Join Date
    04-09-2007
    Posts
    5

    VBA Code vs Macro Recording code

    Hi all, I have an excel spreadsheet that I would like to check for "," and replace with " ". I used a macro recording to get the code but when I enter this code with the rest of my VBA coding it does not work. The code does not come back in error it just steps through each line without making the changes I require. Below is the code

    'Replace all commas with blanks in the text field.
    With Sheets("Form")
     
            Range("R16:R1015").Select
            
    
                Selection.Replace What:=",", Replacement:=" ", LookAt:=xlPart, _
                    searchOrder:=xlByRows, MatchCase:=False
                Range("R16").Select
                
                Sender = ActiveWorkbook.Sheets("Form").Cells(8, 18).Value
    
        End With

    If anyone could come back with some suggests as to why this does not work then hat would help me out a great deal.

    Many thanks

    J
    Last edited by VBA Noob; 04-09-2007 at 06:24 AM.

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