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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
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,223,285
Messages
6,171,183
Members
452,389
Latest member
edwardvandepol

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