Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default efficent find all and value

Hi all,

I have a 12MB spreadsheet, in it, it contains many formula scattered all
over each worksheet tab. I need to find a very quick and efficient way to
replace formulas that begins with say, "xyz" and value it.

There are about 15 tabs per workbook and each tab has about 9000 locations/
formulas all over the worksheet that I need to value, and there are about 50
such workbooks every other day.

When I did a find all, in the find dialogue box, it lists all the locations,
I guess, it would be ideal if my code can somehow capture that list of cell
locations and just run throught that list for each tab and value those cells
and move onto next worksheet and then after one workbook is done I can move
to the next workbook and so on, until all workbooks are done.

If there are other efficient ways, I would be open to them as well. Please
share with me your thoughts and code snippets. Thank so much for your help.

Ben



--

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default efficent find all and value

Your description is a little hard to follow but here is what I come up with.
This sub looks through all of the formulas on all of the sheets in the
activeworkbook, replacing "xyz" with "zxy"...

Sub ReplaceStuff()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Cells.Replace What:="xyz", Replacement:="zxy", LookAt:=xlFormulas
Next wks

End Sub
--
HTH...

Jim Thomlinson


"Ben" wrote:

Hi all,

I have a 12MB spreadsheet, in it, it contains many formula scattered all
over each worksheet tab. I need to find a very quick and efficient way to
replace formulas that begins with say, "xyz" and value it.

There are about 15 tabs per workbook and each tab has about 9000 locations/
formulas all over the worksheet that I need to value, and there are about 50
such workbooks every other day.

When I did a find all, in the find dialogue box, it lists all the locations,
I guess, it would be ideal if my code can somehow capture that list of cell
locations and just run throught that list for each tab and value those cells
and move onto next worksheet and then after one workbook is done I can move
to the next workbook and so on, until all workbooks are done.

If there are other efficient ways, I would be open to them as well. Please
share with me your thoughts and code snippets. Thank so much for your help.

Ben



--

  #3   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default efficent find all and value

Jim,

Thanks for your response. I actually want to replace the formula that
begins with "xyz" with the actual value. That is, when I find such a cell
with the formula, I want to do a copy and paste value to it. Thanks for your
help.

Ben


--



"Jim Thomlinson" wrote:

Your description is a little hard to follow but here is what I come up with.
This sub looks through all of the formulas on all of the sheets in the
activeworkbook, replacing "xyz" with "zxy"...

Sub ReplaceStuff()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Cells.Replace What:="xyz", Replacement:="zxy", LookAt:=xlFormulas
Next wks

End Sub
--
HTH...

Jim Thomlinson


"Ben" wrote:

Hi all,

I have a 12MB spreadsheet, in it, it contains many formula scattered all
over each worksheet tab. I need to find a very quick and efficient way to
replace formulas that begins with say, "xyz" and value it.

There are about 15 tabs per workbook and each tab has about 9000 locations/
formulas all over the worksheet that I need to value, and there are about 50
such workbooks every other day.

When I did a find all, in the find dialogue box, it lists all the locations,
I guess, it would be ideal if my code can somehow capture that list of cell
locations and just run throught that list for each tab and value those cells
and move onto next worksheet and then after one workbook is done I can move
to the next workbook and so on, until all workbooks are done.

If there are other efficient ways, I would be open to them as well. Please
share with me your thoughts and code snippets. Thank so much for your help.

Ben



--

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default efficent find all and value

Dim rng as Range, cell as Range
set rng = cells.SpecialCells(xlFormulas)
for each cell in rng
if instr(1,cell.Formula,"xyz",vbTextCompare) then
cell.Formula = cell.Value
end if
Next

--
Regards,
Tom Ogilvy

"Ben" wrote in message
...
Jim,

Thanks for your response. I actually want to replace the formula that
begins with "xyz" with the actual value. That is, when I find such a cell
with the formula, I want to do a copy and paste value to it. Thanks for

your
help.

Ben


--



"Jim Thomlinson" wrote:

Your description is a little hard to follow but here is what I come up

with.
This sub looks through all of the formulas on all of the sheets in the
activeworkbook, replacing "xyz" with "zxy"...

Sub ReplaceStuff()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Cells.Replace What:="xyz", Replacement:="zxy",

LookAt:=xlFormulas
Next wks

End Sub
--
HTH...

Jim Thomlinson


"Ben" wrote:

Hi all,

I have a 12MB spreadsheet, in it, it contains many formula scattered

all
over each worksheet tab. I need to find a very quick and efficient

way to
replace formulas that begins with say, "xyz" and value it.

There are about 15 tabs per workbook and each tab has about 9000

locations/
formulas all over the worksheet that I need to value, and there are

about 50
such workbooks every other day.

When I did a find all, in the find dialogue box, it lists all the

locations,
I guess, it would be ideal if my code can somehow capture that list of

cell
locations and just run throught that list for each tab and value those

cells
and move onto next worksheet and then after one workbook is done I can

move
to the next workbook and so on, until all workbooks are done.

If there are other efficient ways, I would be open to them as well.

Please
share with me your thoughts and code snippets. Thank so much for your

help.

Ben



--



  #5   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default efficent find all and value

Thanks, Tom. You should DEFINITELY consider putting your thoughts and
knowledge about Excel into a book. It would definitely be on my bookshelf,
without doubt.

Ben
--



"Tom Ogilvy" wrote:

Dim rng as Range, cell as Range
set rng = cells.SpecialCells(xlFormulas)
for each cell in rng
if instr(1,cell.Formula,"xyz",vbTextCompare) then
cell.Formula = cell.Value
end if
Next

--
Regards,
Tom Ogilvy

"Ben" wrote in message
...
Jim,

Thanks for your response. I actually want to replace the formula that
begins with "xyz" with the actual value. That is, when I find such a cell
with the formula, I want to do a copy and paste value to it. Thanks for

your
help.

Ben


--



"Jim Thomlinson" wrote:

Your description is a little hard to follow but here is what I come up

with.
This sub looks through all of the formulas on all of the sheets in the
activeworkbook, replacing "xyz" with "zxy"...

Sub ReplaceStuff()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Cells.Replace What:="xyz", Replacement:="zxy",

LookAt:=xlFormulas
Next wks

End Sub
--
HTH...

Jim Thomlinson


"Ben" wrote:

Hi all,

I have a 12MB spreadsheet, in it, it contains many formula scattered

all
over each worksheet tab. I need to find a very quick and efficient

way to
replace formulas that begins with say, "xyz" and value it.

There are about 15 tabs per workbook and each tab has about 9000

locations/
formulas all over the worksheet that I need to value, and there are

about 50
such workbooks every other day.

When I did a find all, in the find dialogue box, it lists all the

locations,
I guess, it would be ideal if my code can somehow capture that list of

cell
locations and just run throught that list for each tab and value those

cells
and move onto next worksheet and then after one workbook is done I can

move
to the next workbook and so on, until all workbooks are done.

If there are other efficient ways, I would be open to them as well.

Please
share with me your thoughts and code snippets. Thank so much for your

help.

Ben



--






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default efficent find all and value

Thanks for the sentiment, but
There would be too many typos and they would probably want Dave Peterson to
Review it. Yikes!

--
Regards,
Tom Ogilvy

"Ben" wrote in message
...
Thanks, Tom. You should DEFINITELY consider putting your thoughts and
knowledge about Excel into a book. It would definitely be on my

bookshelf,
without doubt.

Ben
--



"Tom Ogilvy" wrote:

Dim rng as Range, cell as Range
set rng = cells.SpecialCells(xlFormulas)
for each cell in rng
if instr(1,cell.Formula,"xyz",vbTextCompare) then
cell.Formula = cell.Value
end if
Next

--
Regards,
Tom Ogilvy

"Ben" wrote in message
...
Jim,

Thanks for your response. I actually want to replace the formula that
begins with "xyz" with the actual value. That is, when I find such a

cell
with the formula, I want to do a copy and paste value to it. Thanks

for
your
help.

Ben


--



"Jim Thomlinson" wrote:

Your description is a little hard to follow but here is what I come

up
with.
This sub looks through all of the formulas on all of the sheets in

the
activeworkbook, replacing "xyz" with "zxy"...

Sub ReplaceStuff()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Cells.Replace What:="xyz", Replacement:="zxy",

LookAt:=xlFormulas
Next wks

End Sub
--
HTH...

Jim Thomlinson


"Ben" wrote:

Hi all,

I have a 12MB spreadsheet, in it, it contains many formula

scattered
all
over each worksheet tab. I need to find a very quick and

efficient
way to
replace formulas that begins with say, "xyz" and value it.

There are about 15 tabs per workbook and each tab has about 9000

locations/
formulas all over the worksheet that I need to value, and there

are
about 50
such workbooks every other day.

When I did a find all, in the find dialogue box, it lists all the

locations,
I guess, it would be ideal if my code can somehow capture that

list of
cell
locations and just run throught that list for each tab and value

those
cells
and move onto next worksheet and then after one workbook is done I

can
move
to the next workbook and so on, until all workbooks are done.

If there are other efficient ways, I would be open to them as

well.
Please
share with me your thoughts and code snippets. Thank so much for

your
help.

Ben



--






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default efficent find all and value

Not so bad...

You could always say it was in its first printing. And then give them a
mistyped URL to find the corrections. <vbg.


Tom Ogilvy wrote:

Thanks for the sentiment, but
There would be too many typos and they would probably want Dave Peterson to
Review it. Yikes!

--
Regards,
Tom Ogilvy

"Ben" ? wrote in message
...
? Thanks, Tom. You should DEFINITELY consider putting your thoughts and
? knowledge about Excel into a book. It would definitely be on my
bookshelf,
? without doubt.
?
? Ben
? --
?
?
?
? "Tom Ogilvy" wrote:
?
? ? Dim rng as Range, cell as Range
? ? set rng = cells.SpecialCells(xlFormulas)
? ? for each cell in rng
? ? if instr(1,cell.Formula,"xyz",vbTextCompare) then
? ? cell.Formula = cell.Value
? ? end if
? ? Next
? ?
? ? --
? ? Regards,
? ? Tom Ogilvy
? ?
? ? "Ben" ? wrote in message
? ? ...
? ? ? Jim,
? ? ?
? ? ? Thanks for your response. I actually want to replace the formula that
? ? ? begins with "xyz" with the actual value. That is, when I find such a
cell
? ? ? with the formula, I want to do a copy and paste value to it. Thanks
for
? ? your
? ? ? help.
? ? ?
? ? ? Ben
? ? ?
? ? ?
? ? ? --
? ? ?
? ? ?
? ? ?
? ? ? "Jim Thomlinson" wrote:
? ? ?
? ? ? ? Your description is a little hard to follow but here is what I come
up
? ? with.
? ? ? ? This sub looks through all of the formulas on all of the sheets in
the
? ? ? ? activeworkbook, replacing "xyz" with "zxy"...
? ? ? ?
? ? ? ? Sub ReplaceStuff()
? ? ? ? Dim wks As Worksheet
? ? ? ?
? ? ? ? For Each wks In ActiveWorkbook.Worksheets
? ? ? ? wks.Cells.Replace What:="xyz", Replacement:="zxy",
? ? LookAt:=xlFormulas
? ? ? ? Next wks
? ? ? ?
? ? ? ? End Sub
? ? ? ? --
? ? ? ? HTH...
? ? ? ?
? ? ? ? Jim Thomlinson
? ? ? ?
? ? ? ?
? ? ? ? "Ben" wrote:
? ? ? ?
? ? ? ? ? Hi all,
? ? ? ? ?
? ? ? ? ? I have a 12MB spreadsheet, in it, it contains many formula
scattered
? ? all
? ? ? ? ? over each worksheet tab. I need to find a very quick and
efficient
? ? way to
? ? ? ? ? replace formulas that begins with say, "xyz" and value it.
? ? ? ? ?
? ? ? ? ? There are about 15 tabs per workbook and each tab has about 9000
? ? locations/
? ? ? ? ? formulas all over the worksheet that I need to value, and there
are
? ? about 50
? ? ? ? ? such workbooks every other day.
? ? ? ? ?
? ? ? ? ? When I did a find all, in the find dialogue box, it lists all the
? ? locations,
? ? ? ? ? I guess, it would be ideal if my code can somehow capture that
list of
? ? cell
? ? ? ? ? locations and just run throught that list for each tab and value
those
? ? cells
? ? ? ? ? and move onto next worksheet and then after one workbook is done I
can
? ? move
? ? ? ? ? to the next workbook and so on, until all workbooks are done.
? ? ? ? ?
? ? ? ? ? If there are other efficient ways, I would be open to them as
well.
? ? Please
? ? ? ? ? share with me your thoughts and code snippets. Thank so much for
your
? ? help.
? ? ? ? ?
? ? ? ? ? Ben
? ? ? ? ?
? ? ? ? ?
? ? ? ? ?
? ? ? ? ? --
? ? ? ? ?
? ?
? ?
? ?


--

Dave Peterson
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 First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Despite data existing in Excel 2002 spreadsheet Find doesn't find AnnieB Excel Discussion (Misc queries) 1 June 16th 06 02:15 AM
why would a spreadsheet be more useful and efficent? merry New Users to Excel 2 April 28th 06 12:04 AM
Efficent way of setting sparse array of formulas? Josh Sale Excel Programming 5 August 16th 05 03:02 PM
find and delete text, find a 10-digit number and put it in a textbox Paul Excel Programming 3 November 16th 04 04:21 PM


All times are GMT +1. The time now is 02:35 AM.

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"