Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Raja
 
Posts: n/a
Default Cell Reference help required


Hello All,

I have a problem with Cell reference between spreadsheets. Help would
be highly appreciated.

Here is what I need.

I have 30 different spreadsheets in a workbook. Worksheet names (Aug01,
Aug02, Aug 03….Aug30). All the sheets are similar. I need to refer the
totals of the previous worksheet in the current one.

Example:

D5 of sheet Aug30 to D4 of sheet Aug29, ('Aug29'!D5)
D5 of sheet Aug29 to D4 of sheet Aug28, ('Aug28'!D5)
  #2   Report Post  
Mangesh Yadav
 
Posts: n/a
Default

Run this VBA code

Sub RunThis()

ReDim ShtNames(0 To Worksheets.Count - 1)
i = 0
For Each sht In Worksheets
ShtNames(i) = sht.Name
i = i + 1
Next

For j = 1 To UBound(ShtNames)
Worksheets(ShtNames(j)).Range("D5") = "=" & ShtNames(j - 1) & "!D4"
Next

End Sub

This will do the following:
In Aug2 sheet cell D5, it will put =Aug1!D4
and so on.

Mangesh



"Raja" wrote in message
...

Hello All,

I have a problem with Cell reference between spreadsheets. Help would
be highly appreciated.

Here is what I need.

I have 30 different spreadsheets in a workbook. Worksheet names (Aug01,
Aug02, Aug 03..Aug30). All the sheets are similar. I need to refer the
totals of the previous worksheet in the current one.

Example:

D5 of sheet Aug30 to D4 of sheet Aug29, ('Aug29'!D5)
D5 of sheet Aug29 to D4 of sheet Aug28, ('Aug28'!D5)



  #3   Report Post  
Raja
 
Posts: n/a
Default


Dear Mangesh,

Thanks a lot for the code. I am a dummie ..so please explain me on
where and how to run the code.

I am using MS office 2000

Raja

Mangesh Yadav Wrote:
Run this VBA code

Sub RunThis()

ReDim ShtNames(0 To Worksheets.Count - 1)
i = 0
For Each sht In Worksheets
ShtNames(i) = sht.Name
i = i + 1
Next

For j = 1 To UBound(ShtNames)
Worksheets(ShtNames(j)).Range("D5") = "=" & ShtNames(j - 1) & "!D4"
Next

End Sub

This will do the following:
In Aug2 sheet cell D5, it will put =Aug1!D4
and so on.

Mangesh



--
Raja


------------------------------------------------------------------------
Raja's Profile: http://www.excelforum.com/member.php...o&userid=25901
View this thread: http://www.excelforum.com/showthread...hreadid=393232

  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Nice simple solution :-)

=IF(RIGHT(MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255),2)<"
01",INDIRECT("'"&LEFT(MID(CELL("Filename",A1),FIND ("]",CELL("Filename",A1))+
1,255),LEN(MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255))-2)&
TEXT(VALUE(RIGHT(MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255
),2))-1,"00")&"'!D5"),"")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Raja" wrote in message
...

Hello All,

I have a problem with Cell reference between spreadsheets. Help would
be highly appreciated.

Here is what I need.

I have 30 different spreadsheets in a workbook. Worksheet names (Aug01,
Aug02, Aug 03..Aug30). All the sheets are similar. I need to refer the
totals of the previous worksheet in the current one.

Example:

D5 of sheet Aug30 to D4 of sheet Aug29, ('Aug29'!D5)
D5 of sheet Aug29 to D4 of sheet Aug28, ('Aug28'!D5)



  #5   Report Post  
Krishnakumar
 
Posts: n/a
Default


Hi,

I think Bob's formula can be shortened to like this,

=IF(RIGHT(x,2)="01","",INDIRECT("Aug"&TEXT(--RIGHT(x,2)-1,"00")&"!D5"))

where x,

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

HTH


--
Krishnakumar


------------------------------------------------------------------------
Krishnakumar's Profile: http://www.excelforum.com/member.php...o&userid=20138
View this thread: http://www.excelforum.com/showthread...hreadid=393232



  #6   Report Post  
Mangesh Yadav
 
Posts: n/a
Default

If you have not used Bob's formula as yet, then to use my code, simply press
Alt F11 in excel. This opens the VBE. Go to Insert, and insert a new module.
Place the code here. And click on the right-pointed triangle to run it.

Mangesh



"Raja" wrote in message
...

Dear Mangesh,

Thanks a lot for the code. I am a dummie ..so please explain me on
where and how to run the code.

I am using MS office 2000

Raja

Mangesh Yadav Wrote:
Run this VBA code

Sub RunThis()

ReDim ShtNames(0 To Worksheets.Count - 1)
i = 0
For Each sht In Worksheets
ShtNames(i) = sht.Name
i = i + 1
Next

For j = 1 To UBound(ShtNames)
Worksheets(ShtNames(j)).Range("D5") = "=" & ShtNames(j - 1) & "!D4"
Next

End Sub

This will do the following:
In Aug2 sheet cell D5, it will put =Aug1!D4
and so on.

Mangesh



--
Raja


------------------------------------------------------------------------
Raja's Profile:

http://www.excelforum.com/member.php...o&userid=25901
View this thread: http://www.excelforum.com/showthread...hreadid=393232



  #7   Report Post  
Bob Phillips
 
Posts: n/a
Default

Yeah but assumes Aug. Mine will work with Aug, Sep, etc, which I am sure is
what the OP would want. Put that back in and it is no shorter.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Krishnakumar"
wrote in message
news:Krishnakumar.1taimi_1123243557.8972@excelforu m-nospam.com...

Hi,

I think Bob's formula can be shortened to like this,

=IF(RIGHT(x,2)="01","",INDIRECT("Aug"&TEXT(--RIGHT(x,2)-1,"00")&"!D5"))

where x,

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

HTH


--
Krishnakumar


------------------------------------------------------------------------
Krishnakumar's Profile:

http://www.excelforum.com/member.php...o&userid=20138
View this thread: http://www.excelforum.com/showthread...hreadid=393232



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
Cell Reference help required Raja Excel Discussion (Misc queries) 1 August 5th 05 12:04 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Flexible Cell Reference Brandt Excel Discussion (Misc queries) 5 June 2nd 05 10:23 PM
reference cell value from fixed column with variable row bob z Excel Discussion (Misc queries) 0 May 23rd 05 11:30 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM


All times are GMT +1. The time now is 01:52 PM.

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"