Hi all. My current dilemma is this: I am writing a macro that will do a few things but I am stuck at having to do a countif using a range from a different workbook. Now this workbook is a binary one (xlsb not xlsx) and is password protected. It has multiple sheets as well.
What I want to do is a countif using a value from my workbook (the one with the code in it) as the criteria and using a column from a sheet from the closed xlsb workbook for my range:
COUNTIF(Range,Value)
Range = column D from a sheet in the closed workbook that is password protected
Value= cell from current open workbook
I am using WorksheetFunction.CountIf. I only need the range, which i tried setting up but I am getting runtime error 9 "Subscript out of range". I used a range variable MyRange and tried referencing the workbook with
Set MyRange=Workbooks("drive:\Folder1\Folder2\WorkbookName.xlsb").Worksheets("Sheet4").Range("D:D")
So, is it possible to do a countif using this closed, password protected workbook? And if so, how do I reference the workbook?
Thank you all
What I want to do is a countif using a value from my workbook (the one with the code in it) as the criteria and using a column from a sheet from the closed xlsb workbook for my range:
COUNTIF(Range,Value)
Range = column D from a sheet in the closed workbook that is password protected
Value= cell from current open workbook
I am using WorksheetFunction.CountIf. I only need the range, which i tried setting up but I am getting runtime error 9 "Subscript out of range". I used a range variable MyRange and tried referencing the workbook with
Set MyRange=Workbooks("drive:\Folder1\Folder2\WorkbookName.xlsb").Worksheets("Sheet4").Range("D:D")
So, is it possible to do a countif using this closed, password protected workbook? And if so, how do I reference the workbook?
Thank you all