Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Non text function in two workbooks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Non text function in two workbooks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Non text function in two workbooks

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
search text in other workbooks jtaiariol Excel Worksheet Functions 0 July 8th 08 05:25 PM
Linking text Data between 2 workbooks Speluchi Excel Discussion (Misc queries) 1 February 10th 06 02:47 PM
how do I combine workbooks, adding new text Peterd35 Excel Discussion (Misc queries) 1 June 15th 05 03:36 PM
sub vs. function bhavior regarding 'Workbooks' obj. functions Ali Ahmed Excel Programming 1 January 5th 04 09:12 PM
Exposing a function to other workbooks Ameritech Excel Programming 1 November 19th 03 10:38 AM


All times are GMT +1. The time now is 06:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"