Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Advanced Find and Replace Question

I have a spreadsheet that includes ditto marks in several cells as a
way to make it more "readable". I need to dump this into Access so I
need to get rid of the ditto marks. My question is, how do I get excel
to replace all ditto marks with the value of the cell directly above
it? When I go to "Find and Replace" it wants me to enter the actual
value, but this value will change according to the value of the cell
directly above it.

Thanks!

Ryan

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Advanced Find and Replace Question

select an area of cells where you need to replace values with values
from cells above

and run this code

:======================

Sub ReplaceWithAbove()

Dim cl As Range

For Each cl In Selection
If cl.Value = "@" Then
cl.Value = cl.Offset(-1, 0).Value
End If
Next cl

End Sub

:======================

As you can see in my code I have had to use @ to switch
You may first have to perform a Find Replace to change all ditto marks
to @

Let us know hope you get on

cheers

somethinglikeant
http://www.excel-ant.co.uk

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Advanced Find and Replace Question

You have a few ways...

I'd do this:

tools|options|General Tab|check R1C1 reference style
select the range to fix
edit|Replace
what: " (I used double quotes for ditto marks)
with: =r[1]c
replace all

This replaces the value with a formula that says to use the value in the
previous row, but same column.

Then
tools|options|General Tab|uncheck R1C1 reference style
(to set it back to normal)

Finally, change the formulas to values.
Select the range
edit|copy
edit|paste special|values

========================

Another way if you don't have any empty cells to worry about:
Select the range
edit|replace
what: " (your ditto marks)
with: (leave blank)
replace all

Now you can use the tecniques at Debra Dalgleish's site to fill those empty
cells.
http://www.contextures.com/xlDataEntry02.html
Ryan wrote:

I have a spreadsheet that includes ditto marks in several cells as a
way to make it more "readable". I need to dump this into Access so I
need to get rid of the ditto marks. My question is, how do I get excel
to replace all ditto marks with the value of the cell directly above
it? When I go to "Find and Replace" it wants me to enter the actual
value, but this value will change according to the value of the cell
directly above it.

Thanks!

Ryan


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Advanced Find and Replace Question

This worked like a charm! Thanks so much for your help!!!

Ryan

somethinglikeant wrote:
select an area of cells where you need to replace values with values
from cells above

and run this code

:======================

Sub ReplaceWithAbove()

Dim cl As Range

For Each cl In Selection
If cl.Value = "@" Then
cl.Value = cl.Offset(-1, 0).Value
End If
Next cl

End Sub

:======================

As you can see in my code I have had to use @ to switch
You may first have to perform a Find Replace to change all ditto marks
to @

Let us know hope you get on

cheers

somethinglikeant
http://www.excel-ant.co.uk


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
Find & replace question.....I believe anorton Excel Discussion (Misc queries) 13 June 4th 06 01:25 PM
Macro: Find and replace Bertie Excel Discussion (Misc queries) 1 May 29th 06 02:01 PM
How do I find and replace a question mark in Excel? Ranpalandil Excel Discussion (Misc queries) 1 September 7th 05 10:20 PM
Find and replace of word causes change of font formatting jwa90010 New Users to Excel 4 July 22nd 05 08:10 PM
VB Find and Replace Bony_Pony Excel Worksheet Functions 10 December 6th 04 05:45 PM


All times are GMT +1. The time now is 05:54 AM.

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"