LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Paste numbers

I have a problem with a macro. The macro searches a spreadsheet for thousand
separator blanks and other uneccessary blanks. The contents of the
spreadsheet are pasted onto the spreadsheet. Therefore when running the macro
the program stores all values as text, so I cannot use them in any
calculations. How do you solve this? I have tried recording a macro when
changing the format in excel but it does not work? Pleaase please help me , I
really dont understand it!!!!!Thank you very much!!!

This is the code that I use in a sub for removing the blanks:
Dim WB As Workbook
Dim SH As Worksheet
Dim rng, rCell As Range
Set WB = ActiveWorkbook
Set SH = WB.Sheets("Beräkning")
Set rng = SH.UsedRange
'Set rng = SH.Range("A1:p100")

For Each rCell In rng.Cells
With rCell
If Not IsEmpty(.Value) Then
If Not UCase(.Value) Like "*[A-Z]*" Then
.Replace What:=" ", Replacement:=""
End If
End If
End With
Next rCell

Any help is ver much appreciated!!
Cells.Replace What:=" ", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False


I have also tried (but it does not work when pasting):



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I cannot paste values as numbers msnyc07 Excel Discussion (Misc queries) 3 March 2nd 10 10:27 PM
copy & paste numbers instead of formula AmmHan Excel Discussion (Misc queries) 2 July 21st 09 02:49 PM
To convert calculated numbers for Cut & Paste dr nemo Excel Discussion (Misc queries) 2 October 31st 08 10:30 PM
Paste Values not pasting numbers Picman Excel Discussion (Misc queries) 3 December 14th 07 04:44 PM


All times are GMT +1. The time now is 04:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"