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: 1
Default Remove blanks


I have posted questions concerning this problem on other forums. I have
macro that does some calculations. It works like this.

1) The user is to paste info (from another program viz. SimCorp
Dimension) onto a spreadsheet and then press a button.
2) when pressing the button my macro is started. The first part of the
macro is to search the info on the spreadsheet for any uneccessary
blanks. Sometime the values that the user pastes into the spreadsheet
are written with thousand separators e.g. "4 000 000". Since I want to
use the values for computations I must remove these blanks.
3) Calculations are made.

The problem is that I do find and remove the blanks but in doing so the
format or some other type of setting is changed for the cells that have
had blanks (that are now removed). The cells looks fine and you can add
the in the spreadsheet one by one. However if you try to use the sum
function or I try to add them together in the macro it does not work.
The code for finding and removing blanks ( I got this from Norman Jones
who has helped me alot) is:

Public Sub findAndRemoveBlanks()
ActiveSheet.UsedRange.Replace What:=Chr(160), _
Replacement:="", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub

If you have any idea on how to solve this I would be most greatful for
your help. Also if anyone should be willing to look at my spreadsheet
(with the values inside it) I think that would be very good since I
really have tried to solve and I have gotten alot of help on various
discussion forums but I still cant solve it. Thank you all very much!!!


--
freddie mac
------------------------------------------------------------------------
freddie mac's Profile: http://www.excelforum.com/member.php...o&userid=36101
View this thread: http://www.excelforum.com/showthread...hreadid=558776

 
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
remove duplicates except blanks jat Excel Worksheet Functions 2 December 11th 09 12:25 PM
remove blanks using formula Gotroots Excel Worksheet Functions 5 December 9th 09 10:52 AM
Concatenate and remove blanks PeterW Excel Worksheet Functions 3 January 19th 06 06:04 PM
Remove blanks from text Delboy Excel Programming 6 December 2nd 05 11:04 AM
Remove blanks from list via VBA TheRobsterUK[_8_] Excel Programming 3 November 17th 05 06:10 AM


All times are GMT +1. The time now is 12:56 PM.

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

About Us

"It's about Microsoft Excel"