Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default If cell contains specific formula (GETPIVOTDATA)

Hi,

I have a masterfile, which imports data from various other files (that
needs to be openened to refresh). After gathering the data some of the
sheets are send out to the responsible persons who have to fill in
data.

In the masterfile I have various sheets with numerous cells that
contains formulas (for example sheet P&L or Sales). Because some cells
contains formulas that have the GETPIVOTDATA formula, I want to build
a macro that searches for these cells and copy paste these formulas as
hard values after refreshing all data and files (and before sending it
out).

EXCEL 2007 is used by me.

Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default If cell contains specific formula (GETPIVOTDATA)

A. Karatas wrote:
Hi,

I have a masterfile, which imports data from various other files (that
needs to be openened to refresh). After gathering the data some of the
sheets are send out to the responsible persons who have to fill in
data.

In the masterfile I have various sheets with numerous cells that
contains formulas (for example sheet P&L or Sales). Because some cells
contains formulas that have the GETPIVOTDATA formula, I want to build
a macro that searches for these cells and copy paste these formulas as
hard values after refreshing all data and files (and before sending it
out).

EXCEL 2007 is used by me.

Thanks in advance


This works in Excel 2003. I'm sure it can be improved upon...

Sub test()
Dim c As Range
For Each c In ActiveSheet.UsedRange
'Debug.Print c.Address, c.Formula
If c.Formula Like "=GETPIVOTDATA*" Then
c.Copy
c.PasteSpecial xlPasteValues
End If
Next
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default If cell contains specific formula (GETPIVOTDATA)

On Aug 7, 12:18*am, smartin wrote:
A.Karataswrote:
Hi,


I have a masterfile, which imports data from various other files (that
needs to be openened to refresh). After gathering the data some of the
sheets are send out to the responsible persons who have to fill in
data.


In the masterfile I have various sheets with numerous cells that
contains formulas (for example sheet P&L or Sales). Because some cells
contains formulas that have the GETPIVOTDATA formula, I want to build
a macro that searches for these cells and copy paste these formulas as
hard values after refreshing all data and files (and before sending it
out).


EXCEL 2007 is used by me.


Thanks in advance


This works in Excel 2003. I'm sure it can be improved upon...

Sub test()
* * *Dim c As Range
* * *For Each c In ActiveSheet.UsedRange
* * * * *'Debug.Print c.Address, c.Formula
* * * * *If c.Formula Like "=GETPIVOTDATA*" Then
* * * * * * *c.Copy
* * * * * * *c.PasteSpecial xlPasteValues
* * * * *End If
* * *Next
End Sub- Hide quoted text -

- Show quoted text -


Works great.

Thankx
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
How to translate a getpivotdata formula into a cell reference mbardon Excel Discussion (Misc queries) 0 February 11th 10 10:01 AM
Edit a GETPIVOTDATA formula? winnie123 Excel Programming 5 October 6th 08 01:08 PM
GetPivotData from OLAP Cube Cell Referencing Formula. Bazy2k Excel Worksheet Functions 1 June 11th 08 10:09 AM
GETPIVOTDATA FORMULA nazzoli Excel Worksheet Functions 0 November 22nd 05 09:41 PM
Using a cell ref for the data_field arg in a GETPIVOTDATA formula Sam Excel Programming 0 November 24th 04 02:01 PM


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