Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default BLANK CELLS ARE NOT ACTUALLY BLANK

Hi!
I have a data which were having the leading spaces in them.I removed the
leading spaces using the following formula
=replace(A2,1,find(LEFT(TRIM(A2),2),A2)-1,"")
It worked and my leading spaces are removed....then i pasted it like a value.
Now the problem is that when i am doing F5Specialblanks then the blank
cells are not highlighting as a blank.
i want to actually delete the blank cells across the rows

Please help me

Thanks in Advance

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default BLANK CELLS ARE NOT ACTUALLY BLANK

Another way to remove the leading spaces:
=MID(A2,FIND(LEFT(TRIM(A2),1),A2),99)
(99 is a number large enough for the longest string)

If you wanted to remove leading, trailing and reduce multiple consecutive
internal spaces to a single space, you could use:
=trim(a2)

But if the result of the formula is the "" string, then yep. That cell isn't
empty--even after you convert to values.

Saved from a previous post:

If you want to see what's left in that cell after you convert ="" to values,
try:
Tools|Options|Transition Tab|Toggle Transition Navigation keys on.

Then select one of those cells and look at the formula bar. You'll see an
apostrophe. (Don't forget to toggle the setting to off.)

When I want to clean up this detritus, I do this:

Select the range (ctrl-a a few times to select all the cells)
Edit|Replace
what: (leave blank)
with: $$$$$
replace all

Immediately followed by:
Edit|Replace
what: $$$$$
with: (leave blank)
replace all

In code you could do something like:

Option Explicit
Sub testme()
With ActiveSheet
With .cells 'or a specific range: With .Range("D:D")
.Replace what:="", replacement:="$$$$$", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False
.Replace what:="$$$$$", replacement:="", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False
End With
End With
End Sub

Shilpi wrote:

Hi!
I have a data which were having the leading spaces in them.I removed the
leading spaces using the following formula
=replace(A2,1,find(LEFT(TRIM(A2),2),A2)-1,"")
It worked and my leading spaces are removed....then i pasted it like a value.
Now the problem is that when i am doing F5Specialblanks then the blank
cells are not highlighting as a blank.
i want to actually delete the blank cells across the rows

Please help me

Thanks in Advance


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default BLANK CELLS ARE NOT ACTUALLY BLANK

Hi,

Here is another variations:

1. Enter the following formula:
=IF(LEFT(A2)=" ","xxxx"&A2,IF(A2="","xxxx "))

2. Then copy, paste special values.
3. Press Ctrl+H and enter xxxx (space followed by xxxx)
4. Click Replace All.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Shilpi" wrote:

Hi!
I have a data which were having the leading spaces in them.I removed the
leading spaces using the following formula
=replace(A2,1,find(LEFT(TRIM(A2),2),A2)-1,"")
It worked and my leading spaces are removed....then i pasted it like a value.
Now the problem is that when i am doing F5Specialblanks then the blank
cells are not highlighting as a blank.
i want to actually delete the blank cells across the rows

Please help me

Thanks in Advance

Reply
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
Index/match - make blank cells return a blank value. diaare Excel Worksheet Functions 3 May 3rd 23 03:44 AM
Nested IF - return a blank when compared cells are blank Struggling in Sheffield[_2_] New Users to Excel 2 February 9th 09 08:14 PM
Quantity Blank, Remaining cells in row appear Blank ajaminb Excel Worksheet Functions 8 September 28th 08 11:40 PM
Maximum Number of Blank Cells between Non Blank Cells in a Range Mal Excel Worksheet Functions 5 November 3rd 07 08:21 AM
Imported Data creates blank cells that aren't really blank JackieD Excel Worksheet Functions 14 February 23rd 06 12:57 AM


All times are GMT +1. The time now is 12: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"