#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 471
Default Indirect Function

I have a lot of formulas in a sheet that look like this:

=INDIRECT("'" &"Summary by Unit & Class "&$AA$1 &"'!" &
columnletter(COLUMN(B47)) & ROW(C45)-1)

When I open the file, oftentimes these formulas have #Value in them. I just
hit F9 and it goes away. The calculation mode is automatic and I don't want
end users having to refresh to get rid of the errors in cells. Ideas?

Note: Columnletter is a UDF:

Function ColumnLetter(ByVal colNum As Long) As String
Do
ColumnLetter = Chr$(65 + (colNum - 1) Mod 26) & ColumnLetter
colNum = (colNum - 1) \ 26
Loop While colNum 0
End Function

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Indirect Function

First thing I would do is get rid of the ColumnLetter UDF.

=INDIRECT("'Summary by Unit & Class "&$AA$1&"'!R"
&row(c45)-1&"C"&column(B47),false)

To see if that helps.

Mike H. wrote:

I have a lot of formulas in a sheet that look like this:

=INDIRECT("'" &"Summary by Unit & Class "&$AA$1 &"'!" &
columnletter(COLUMN(B47)) & ROW(C45)-1)

When I open the file, oftentimes these formulas have #Value in them. I just
hit F9 and it goes away. The calculation mode is automatic and I don't want
end users having to refresh to get rid of the errors in cells. Ideas?

Note: Columnletter is a UDF:

Function ColumnLetter(ByVal colNum As Long) As String
Do
ColumnLetter = Chr$(65 + (colNum - 1) Mod 26) & ColumnLetter
colNum = (colNum - 1) \ 26
Loop While colNum 0
End Function


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Indirect Function

If AA1 = 1, the below would refer to the sheet 'Summary by Unit & Class 1'
row 44 column 2.

=OFFSET(INDIRECT("'Summary by Unit & Class "&$AA$1&"'!A1"),
ROW(C45)-1,COLUMN(B47))

--
Jacob


"Mike H." wrote:

I have a lot of formulas in a sheet that look like this:

=INDIRECT("'" &"Summary by Unit & Class "&$AA$1 &"'!" &
columnletter(COLUMN(B47)) & ROW(C45)-1)

When I open the file, oftentimes these formulas have #Value in them. I just
hit F9 and it goes away. The calculation mode is automatic and I don't want
end users having to refresh to get rid of the errors in cells. Ideas?

Note: Columnletter is a UDF:

Function ColumnLetter(ByVal colNum As Long) As String
Do
ColumnLetter = Chr$(65 + (colNum - 1) Mod 26) & ColumnLetter
colNum = (colNum - 1) \ 26
Loop While colNum 0
End Function

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Indirect Function

correction.

If AA1 = 1, the below would refer to the sheet 'Summary by Unit & Class 1'
row 45 column 2

=OFFSET(INDIRECT("'Summary by Unit & Class "&$AA$1&"'!A1"),
ROW(C45)-1,COLUMN(B47)-1)


--
Jacob


"Jacob Skaria" wrote:

If AA1 = 1, the below would refer to the sheet 'Summary by Unit & Class 1'
row 44 column 2.

=OFFSET(INDIRECT("'Summary by Unit & Class "&$AA$1&"'!A1"),
ROW(C45)-1,COLUMN(B47))

--
Jacob


"Mike H." wrote:

I have a lot of formulas in a sheet that look like this:

=INDIRECT("'" &"Summary by Unit & Class "&$AA$1 &"'!" &
columnletter(COLUMN(B47)) & ROW(C45)-1)

When I open the file, oftentimes these formulas have #Value in them. I just
hit F9 and it goes away. The calculation mode is automatic and I don't want
end users having to refresh to get rid of the errors in cells. Ideas?

Note: Columnletter is a UDF:

Function ColumnLetter(ByVal colNum As Long) As String
Do
ColumnLetter = Chr$(65 + (colNum - 1) Mod 26) & ColumnLetter
colNum = (colNum - 1) \ 26
Loop While colNum 0
End Function

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 471
Default Indirect Function

Do I have to have the excel options set to R1C1-type formulas to get this to
work? I can't seem to get your formula to return anything but #REF!. Ideas?

"Dave Peterson" wrote:

First thing I would do is get rid of the ColumnLetter UDF.

=INDIRECT("'Summary by Unit & Class "&$AA$1&"'!R"
&row(c45)-1&"C"&column(B47),false)

To see if that helps.

Mike H. wrote:

I have a lot of formulas in a sheet that look like this:

=INDIRECT("'" &"Summary by Unit & Class "&$AA$1 &"'!" &
columnletter(COLUMN(B47)) & ROW(C45)-1)

When I open the file, oftentimes these formulas have #Value in them. I just
hit F9 and it goes away. The calculation mode is automatic and I don't want
end users having to refresh to get rid of the errors in cells. Ideas?

Note: Columnletter is a UDF:

Function ColumnLetter(ByVal colNum As Long) As String
Do
ColumnLetter = Chr$(65 + (colNum - 1) Mod 26) & ColumnLetter
colNum = (colNum - 1) \ 26
Loop While colNum 0
End Function


--

Dave Peterson
.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Indirect Function

=indirect() has a second parm that indicates whether your string is in A1
reference style or R1C1 reference style.

I'm guessing that the value in AA1 creates a worksheet name that doesn't exist.

Mike H. wrote:

Do I have to have the excel options set to R1C1-type formulas to get this to
work? I can't seem to get your formula to return anything but #REF!. Ideas?

"Dave Peterson" wrote:

First thing I would do is get rid of the ColumnLetter UDF.

=INDIRECT("'Summary by Unit & Class "&$AA$1&"'!R"
&row(c45)-1&"C"&column(B47),false)

To see if that helps.

Mike H. wrote:

I have a lot of formulas in a sheet that look like this:

=INDIRECT("'" &"Summary by Unit & Class "&$AA$1 &"'!" &
columnletter(COLUMN(B47)) & ROW(C45)-1)

When I open the file, oftentimes these formulas have #Value in them. I just
hit F9 and it goes away. The calculation mode is automatic and I don't want
end users having to refresh to get rid of the errors in cells. Ideas?

Note: Columnletter is a UDF:

Function ColumnLetter(ByVal colNum As Long) As String
Do
ColumnLetter = Chr$(65 + (colNum - 1) Mod 26) & ColumnLetter
colNum = (colNum - 1) \ 26
Loop While colNum 0
End Function


--

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
Using INDIRECT Function and INDEX Function ChristopherG Excel Discussion (Misc queries) 1 June 10th 09 04:07 PM
INDIRECT function F. Lawrence Kulchar Excel Discussion (Misc queries) 4 June 2nd 08 10:21 AM
Indirect function help please Guy[_2_] Excel Worksheet Functions 10 August 6th 07 11:06 AM
using the INDIRECT function hot dogs Excel Discussion (Misc queries) 1 November 1st 06 12:01 PM
INDIRECT function inside AND function Biff Excel Worksheet Functions 3 September 23rd 06 07:20 PM


All times are GMT +1. The time now is 09:58 AM.

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

About Us

"It's about Microsoft Excel"