ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search for blanks (https://www.excelbanter.com/excel-programming/364337-search-blanks.html)

SamanthaK

Search for blanks
 
How do you write a macro that:
1) Searches an Excel-spreadsheet and checks if contents of is cell is numeric.
2) If content is numeric then search cell for blanks and if blanks are found
replace them with nothing? E.g. I have a cell containing 55 22 11 and I want
to replace it with 552211. However I do not want: e.g. 'Market value' to be
replaced by 'Marketvalue'. Please help me on this one!!!
--
I am very thankful for any fast assistance!

Blue Aardvark

Search for blanks
 
You can use the ISNUMERIC function on a cell to check if its a number, then
use the REPLACE function to replace " " (spaces) with "" (nothing).

Hope that helps!


"SamanthaK" wrote:

How do you write a macro that:
1) Searches an Excel-spreadsheet and checks if contents of is cell is numeric.
2) If content is numeric then search cell for blanks and if blanks are found
replace them with nothing? E.g. I have a cell containing 55 22 11 and I want
to replace it with 552211. However I do not want: e.g. 'Market value' to be
replaced by 'Marketvalue'. Please help me on this one!!!
--
I am very thankful for any fast assistance!



All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com