ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   counting cells and using a variable filename?!?! (https://www.excelbanter.com/excel-programming/277661-counting-cells-using-variable-filename.html)

solo_razor[_10_]

counting cells and using a variable filename?!?!
 
hello,

I have a problem with counting cells. I want to count all cell that
have the same value in a particularly cell and then count the rows and
put that number in a different cell (how many rows where count). Also i
want to acces a variable filename e.g.
remind = InputBox("what is the reminder date?")
...
....
Filename:="c:\dummydir\reminder\reminder-" & remind & ".xls"
.....
.......
...
windows(.......).activate
this does not work: windows("reminder-" & remind & ".xls").activate

hope someone can help

Thx



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Tom Ogilvy

counting cells and using a variable filename?!?!
 
use the countif function, either in the worksheet, or in VBA.

you code should work if you construct a valid filename that matches an
existing file and that is open in Excel. If you get a subscript out of
range error, then you haven't matched the name of an open workbook.
--
Regards,
Tom Ogilvy

"solo_razor" wrote in message
...
hello,

I have a problem with counting cells. I want to count all cell that
have the same value in a particularly cell and then count the rows and
put that number in a different cell (how many rows where count). Also i
want to acces a variable filename e.g.
remind = InputBox("what is the reminder date?")
..
...
Filename:="c:\dummydir\reminder\reminder-" & remind & ".xls"
....
......
..
windows(.......).activate
this does not work: windows("reminder-" & remind & ".xls").activate

hope someone can help

Thx



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 08:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com