Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Macro to paste special value only VLOOKUP formulas

I need a macro that will find all the cells in a worksheet that have a
VLOOKUP formula and do a copy, paste special values on those cells. There
are other formulas (SUM, IF, etc.) in the workbook, but I need to leave those
intact. Can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to paste special value only VLOOKUP formulas

Sub AB()

Set rng = Cells.Find(What:="Vlookup", _
After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

If Not rng Is Nothing Then
Do
rng.Formula = rng.Value
Set rng = Cells.FindNext(rng)
Loop Until rng Is Nothing
End If
End Sub

--
Regards,
Tom Ogilvy

"jeremy nickels" wrote in message
...
I need a macro that will find all the cells in a worksheet that have a
VLOOKUP formula and do a copy, paste special values on those cells. There
are other formulas (SUM, IF, etc.) in the workbook, but I need to leave

those
intact. Can anyone help?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Macro to paste special value only VLOOKUP formulas

Thanks Tom, that works great!

"Tom Ogilvy" wrote:

Sub AB()

Set rng = Cells.Find(What:="Vlookup", _
After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

If Not rng Is Nothing Then
Do
rng.Formula = rng.Value
Set rng = Cells.FindNext(rng)
Loop Until rng Is Nothing
End If
End Sub

--
Regards,
Tom Ogilvy

"jeremy nickels" wrote in message
...
I need a macro that will find all the cells in a worksheet that have a
VLOOKUP formula and do a copy, paste special values on those cells. There
are other formulas (SUM, IF, etc.) in the workbook, but I need to leave

those
intact. Can anyone help?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro to paste special value only VLOOKUP formulas

Hi,

This was very useful for me as well. Could you please also help with
extending this to a scenario where same function needs to be performed on all
worksheet in the workbook?

Thanks
SA


"jeremy nickels" wrote:

Thanks Tom, that works great!

"Tom Ogilvy" wrote:

Sub AB()

Set rng = Cells.Find(What:="Vlookup", _
After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

If Not rng Is Nothing Then
Do
rng.Formula = rng.Value
Set rng = Cells.FindNext(rng)
Loop Until rng Is Nothing
End If
End Sub

--
Regards,
Tom Ogilvy

"jeremy nickels" wrote in message
...
I need a macro that will find all the cells in a worksheet that have a
VLOOKUP formula and do a copy, paste special values on those cells. There
are other formulas (SUM, IF, etc.) in the workbook, but I need to leave

those
intact. Can anyone help?




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
Paste special for formulas ALB Excel Discussion (Misc queries) 4 May 20th 08 12:22 AM
Paste Special - Formulas - Add kcowie Excel Worksheet Functions 1 January 26th 07 01:13 PM
paste special - formulas bjw10 Excel Worksheet Functions 6 February 1st 06 05:17 PM
Paste Special - All but formulas maplesugarsnow Excel Worksheet Functions 5 October 14th 05 03:09 PM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Excel Programming 3 August 7th 04 09:49 PM


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