get total row's value through VBA

bart tuytten

New Member
Joined
Feb 15, 2022
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am trying to get the value of a total row's cell into a variable.
As I hover over the code in the IDE, it shows that the value is equal to 4.
Yet i am not able to introduce that number in the count variable I defined before.

Do you have a suggestion on how to solve this matter?

VBA Code:
 Dim count As Double
    count = Database.Range("Tabel_mat[[#Totalen],[Selectie]]").Value
    MsgBox (count)

regards, Bart
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
count is a term used within VBA and i fear the compiler doesn't know what to do with it.
Try to avoid that kind of names, try for example MyCount or iCount and stay away of those VBA terms for variables
 
Upvote 0
count is a term used within VBA and i fear the compiler doesn't know what to do with it.
Try to avoid that kind of names, try for example MyCount or iCount and stay away of those VBA terms for variables
Hello,
your remark concerning the term is correct indeed.
Yet, when changing the variable's name, the issue remains.
Thank you for your reply.
1644932322181.png
 
Upvote 0
count is a term used within VBA and i fear the compiler doesn't know what to do with it.
Try to avoid that kind of names, try for example MyCount or iCount and stay away of those VBA terms for variables
Hi again, in the meantime it occurred to me that I am using a Dutch Excel version. I forgot about the '#Totalen' needs to be '#Totals'.
An issue i encountered before but i had forgotten, yet i was confused because of the hovering tool indicating a valid result.
I can continue now, yet I thank you for your effort to consider my post.
Regards, Bart
 
Upvote 0
Solution

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

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