Results 1 to 14 of 14

Macro to remove spaces in a number

Threaded View

Howardc1001 Macro to remove spaces in a... 06-10-2021, 07:58 AM
Mumps1 Re: Macro to remove spaces in... 06-10-2021, 08:29 AM
Howardc1001 Re: Macro to remove spaces in... 06-10-2021, 09:39 AM
Sintek Re: Macro to remove spaces in... 06-10-2021, 09:47 AM
Mumps1 Re: Macro to remove spaces in... 06-10-2021, 09:53 AM
Howardc1001 Re: Macro to remove spaces in... 06-10-2021, 10:02 AM
Sintek Re: Macro to remove spaces in... 06-10-2021, 10:01 AM
Howardc1001 Re: Macro to remove spaces in... 06-10-2021, 10:12 AM
Mumps1 Re: Macro to remove spaces in... 06-10-2021, 10:04 AM
Mumps1 Re: Macro to remove spaces in... 06-10-2021, 10:19 AM
Sintek Re: Macro to remove spaces in... 06-10-2021, 10:20 AM
Howardc1001 Re: Macro to remove spaces in... 06-10-2021, 10:26 AM
Sintek Re: Macro to remove spaces in... 06-10-2021, 10:32 AM
Mumps1 Re: Macro to remove spaces in... 06-10-2021, 11:15 AM
  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,873

    Macro to remove spaces in a number

    I have numbers in Col C & D that are imported

    The numbers have spaces in between for eg 459 221,225 985 etc the should look like 459,221 , 225,985 after running the macro

     Sub ReplaceSpacesbetweenNumbers()
    Dim LR As Long
    
            With Sheets("Data Import")
          LR = Cells(.Rows.Count, "A").End(xlUp).Row
    .Range("C1:D" & LR).Replace what:=" ", Replacement:=""
    .Range("C1:D" & LR).NumberFormat = "#,#0;(#,#0)"
    
      End With
            
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Remove Trailing Spaces VBA Macro
    By Bob1955 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-08-2021, 07:43 PM
  2. [SOLVED] Extract a mobile number from string AND remove the spaces?
    By Akshay in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-14-2018, 11:05 AM
  3. [SOLVED] Macro remove leading spaces
    By hftechno in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-30-2018, 09:47 AM
  4. [SOLVED] Need to remove the first 2 characters in string plus spaces on the left with macro
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-15-2014, 06:11 AM
  5. remove spaces and characters in hyperlink - macro
    By missy22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 09:23 AM
  6. Using the Replace to remove Spaces in a Number
    By TWent in forum Excel General
    Replies: 5
    Last Post: 05-09-2011, 02:34 PM
  7. macro to remove spaces at the end of a cell
    By Michael A in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-12-2005, 08:06 PM

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