Table Formulas not auto calculating!!

Villups

New Member
Joined
Dec 29, 2016
Messages
4
Good morning,

This is my first post although I have been looking at this forum and learning from it for a long time.

I found myself in a weird situation when creating a Macro:

1- One of the things I do in my macro is to paste a formula (as a formula) in a cell of an Excel table:
Range(columna & "2").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

2- Once I paste it, this formula is automatically filled in all the cells of my table but it is not calculated!! The only thing that seems to work is manually enter to the first cell and press "Enter"

I have tried setting again calculation to automatic (which is already set), and I have also tried the ".Calculate" command, but none of it works.
Application.Calculation = xlCalculationAutomatic --> not working
Range(columna & "2").Calculate
--> not working
Range(columna & "2:" & columna & lrow).Calculate
--> not workingWorksheets("XXX").UsedRange.Columns(columna).Calculate --> not working​

I please beg you to help me on this!

Thanks.

Kindest regards,

Villups.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
can you please post you're whole code as well as an example of what you are copying/pasting.
 
Upvote 0
Yes,

Here is the code:
Rich (BB code):
    ActiveWorkbook.Sheets("Bloq. Espejo").Select
    Range("B1").Select
    ActiveSheet.ShowAllData  '--> Turn off all filters
    lcol = Cells(1, 1).End(xlToRight).Column + 1
    lrow = Cells(1, 1).End(xlDown).Row
    columna = columna_a_letras(lcol)
    Range(columna & "1") = data2 '--> Creates new column after the last one with the actual date
    ActiveWorkbook.Sheets("Fórmulas").Select 
    Range("B2").Copy '--> Copies the formula from the sheet with the formulas
    ActiveWorkbook.Sheets("Bloq. Espejo").Select
    Range(columna & "2").Select
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False '--> Pastes the formula
    Application.CutCopyMode = False
    Range(columna & "2:" & columna & lrow).Copy
    Range(columna & "2").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = FalseApplication.Calculation = xlCalculationAutomatic --> not working
Range(columna & "2").Calculate --> not working
    Cells.Replace "#N/A", 0, xlWhole '--> Converts all N/A to 0, so since everything is N/A everything is 0
    Cells.Replace "#VALOR", 0, xlWhole

The images are these ones:

(formula sheet)


(Table sheet "Bloq.Espejo")

The formulas only update if I manually press on one of them with the mouse...

Thanks,

Regards.

Marc.
 
Upvote 0
In your images, you have TD2 on the formulas sheet but TD1 on the other sheet. Is that supposed to be correct.
 
Upvote 0
Try change the formulas on the formulas sheet to

=BUSCARV(Bloq.Espejo!$F:$F,TD1!$A:$B,2,FALSO)

Assuming TD1 sheet name doesn't have spaces.
 
Upvote 0
In your images, you have TD2 on the formulas sheet but TD1 on the other sheet. Is that supposed to be correct.

Yes Barry, on B2 the formula is "=BUSCARV($F:$F;'TD1'!$A:$B;2;FALSO)", I took the image pointing to B4, so on the macro this is correct.

I don't understand why do I have to click on the cell in order to update it...

Thanks :)
 
Upvote 0
can you try the below?

=BUSCARV(Bloq.Espejo!$F:$F,TD2!$A:$B,2,FALSO)
 
Upvote 0
can you try the below?

=BUSCARV(Bloq.Espejo!$F:$F,TD2!$A:$B,2,FALSO)

It works Barry! I did not know you had to put the exact sheet even though the formula was in that sheet already,

Thank you very much :)

Regards,

V.
 
Upvote 0
It works Barry! I did not know you had to put the exact sheet even though the formula was in that sheet already,

Thank you very much :)

Regards,

V.

Good stuff. Glad you got it sorted.
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,476
Members
448,967
Latest member
visheshkotha

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