Assign Value to Variable (Excel VBA)
Closed
Hi
I have a variable name CountNumber.
I want it to have a value from the formula "count from A2:A500 range.
How can I write the code in VBA without putting a real formula in excel worksheet.?
2.) Suppose CountNumber already has value.
How can I put the number to a cell, say B5?
I have a variable name CountNumber.
I want it to have a value from the formula "count from A2:A500 range.
How can I write the code in VBA without putting a real formula in excel worksheet.?
2.) Suppose CountNumber already has value.
How can I put the number to a cell, say B5?
Related:
- Assign Value to Variable (Excel VBA)
- Number to words in excel formula without vba - Guide
- Vba case like - Guide
- Excel mod apk for pc - Download - Spreadsheets
- Vba check if value is in array - Guide
- Excel vba hide formula bar - Guide
2 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Jun 19, 2010 at 06:31 AM
Jun 19, 2010 at 06:31 AM
for number 1
You can have
CountNumber = WorksheetFunction.Sum(Range("A2:A500"))
for 2
Cells(5, "B") = CountNumber
You can have
CountNumber = WorksheetFunction.Sum(Range("A2:A500"))
for 2
Cells(5, "B") = CountNumber