Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I declared both a workbook and range and couldnt get my
formula to calculate non text for both the workbook and range. The reason i declared the workbook is because i wanted the formula to appear in another book. Thanks in advance ''''''''''''''''''''''''''''''''''Macro''''''''''' ''''''' Dim IDS As Range Dim Fname As String Fname = ActiveWorkbook.Name ActiveCell.Offset(0, 7).Select Range(Selection, Selection.End(xlDown)).Name = "IDS" ActiveWindow.ActivateNext ActiveCell.FormulaR1C1 = "=COUNT(FNAME&IDS)" '''This comes out as described above im stumped '''is it an indirect? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you could try:
ActiveCell.FormulaR1C1 = "=COUNT(" & "'" & FNAME & "'!IDS)" I think I'd declare a range and use that directly. I don't like using activecell--it moves around too much. dim IDSrng as range with activesheet set IDSrng = .range("c9",.range("c9").end(xldown)) 'or whatever you need??? end with ActiveCell.FormulaR1C1 = "=COUNT(" & IDSrng.address(external:=true) & ")" Jaime wrote: I declared both a workbook and range and couldnt get my formula to calculate non text for both the workbook and range. The reason i declared the workbook is because i wanted the formula to appear in another book. Thanks in advance ''''''''''''''''''''''''''''''''''Macro''''''''''' ''''''' Dim IDS As Range Dim Fname As String Fname = ActiveWorkbook.Name ActiveCell.Offset(0, 7).Select Range(Selection, Selection.End(xlDown)).Name = "IDS" ActiveWindow.ActivateNext ActiveCell.FormulaR1C1 = "=COUNT(FNAME&IDS)" '''This comes out as described above im stumped '''is it an indirect? -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Change that last .formular1c1 to .formula:
ActiveCell.Formula = "=COUNT(" & IDSrng.Address(external:=True) & ")" oopsie. Dave Peterson wrote: you could try: ActiveCell.FormulaR1C1 = "=COUNT(" & "'" & FNAME & "'!IDS)" I think I'd declare a range and use that directly. I don't like using activecell--it moves around too much. dim IDSrng as range with activesheet set IDSrng = .range("c9",.range("c9").end(xldown)) 'or whatever you need??? end with ActiveCell.FormulaR1C1 = "=COUNT(" & IDSrng.address(external:=true) & ")" Jaime wrote: I declared both a workbook and range and couldnt get my formula to calculate non text for both the workbook and range. The reason i declared the workbook is because i wanted the formula to appear in another book. Thanks in advance ''''''''''''''''''''''''''''''''''Macro''''''''''' ''''''' Dim IDS As Range Dim Fname As String Fname = ActiveWorkbook.Name ActiveCell.Offset(0, 7).Select Range(Selection, Selection.End(xlDown)).Name = "IDS" ActiveWindow.ActivateNext ActiveCell.FormulaR1C1 = "=COUNT(FNAME&IDS)" '''This comes out as described above im stumped '''is it an indirect? -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
search text in other workbooks | Excel Worksheet Functions | |||
Linking text Data between 2 workbooks | Excel Discussion (Misc queries) | |||
how do I combine workbooks, adding new text | Excel Discussion (Misc queries) | |||
sub vs. function bhavior regarding 'Workbooks' obj. functions | Excel Programming | |||
Exposing a function to other workbooks | Excel Programming |