Jyggalag

Active Member
Joined
Mar 8, 2021
Messages
422
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi all,

I am having a huge issue at the moment with some macros i created (through record macro).

Basically, I have this excel sheet:

1643989549397.png


I tried to record some macro's, where once I press unfreeze, they post this formula:

=IF(ISBLANK(B9),"",TODAY()) for the left one
=IF(ISBLANK(C9),"",TODAY()) for the right one

And once I press unfreeze, they simply copy paste the date and paste it onto itself as a value, so it is "frozen" and removes the formula.

However, whenever I create these macros, they work once I record 2 of them, but once I make all 4 macro, they end up collectively bugging and showing the error above.

It is true, that cell B9 and C9 are a part of a pivot table, however, the formulas work fine by themselves and the macro is not making any changes to the cells in the pivot table.

So my question is, if somebody can please help me a optimize 2 formulas that freezes and unfreezes (based on the formula above) a cell value?

Would greatly appreciate it so I can finalize my macros!

Thank you so much all :)

Kind regards,
Jyggalag
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Your concept worked fine for me with the simple macros I wrote.

Check your macros that you are not accidentally pasting into B9 and/or C9, instead of your intended targets outside the pivot table.
 
Upvote 0
H
Your concept worked fine for me with the simple macros I wrote.

Check your macros that you are not accidentally pasting into B9 and/or C9, instead of your intended targets outside the pivot table.
Hi,

I am getting this error:

1644219605928.png


I recorded the macros for freeze and unfreeze and in VBA they look like this:

1644219631987.png


Any idea why they do not work?
 
Upvote 0
Your concept worked fine for me with the simple macros I wrote.

Check your macros that you are not accidentally pasting into B9 and/or C9, instead of your intended targets outside the pivot table.
And if I try the unfreeze macro (which should definitely work), I get this error:

1644219740686.png
 
Upvote 0
I fixed it!

It was because when I create the macros, I have to manually click cell C7 and B7 first. I forgot to do this in some of the macros, because I was already in the cell when I started recording.

My bad, apologies for the confusion! Very new to macro recording :)
Your concept worked fine for me with the simple macros I wrote.

Check your macros that you are not accidentally pasting into B9 and/or C9, instead of your intended targets outside the pivot table.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top