Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Location: South Woodham Ferrers, Essex
Posts: 19
Default Copy the same cell from numerouse pages

What i am trying to do is copy the same cell from about 50 pages within the same workbook into a column.

ie

Column A Names all the pages 001-50
Column B Has data from Cell B5 on every page.

I have used ='001'!B5 which works fine but i cant seem to copy it down the list. All it changes is the cell. I want the Cell to stay the same but the page to change.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Kevin B
 
Posts: n/a
Default Copy the same cell from numerouse pages

Insert a worksheet and name it Total. Then press Alt+F11 to open the Visual
Basic Editor

Click on INSERT in the menu and selet MODULE. Copy the code below and paste
it into your blank module, and then locate the following lines of code:

wsTarget.Cells(iRow, 1).Value = _
ws.Range("B%").Value

change the second line that says ws.Range("B5").Value so that the cell is
the cell you wish to pick up.

Move back to Excel and then Click on TOOLS in the menu, select MACROS,
select MACRO. If necessary, highlight AllCellsVals in the list of available
macros and click RUN to execute the macro.

Sub AllCellVals()

Dim wb As Workbook
Dim ws As Worksheet
Dim iRow As Integer
Dim strSheetName As String
Dim strTarget As String
Dim wsTarget As Worksheet

iRow = 1
Set wb = ActiveWorkbook
strTarget = "Total"
Set wsTarget = wb.Sheets(strTarget)

For Each ws In wb.Worksheets
strSheetName = ws.Name
If strSheetName < strTarget Then
wsTarget.Cells(iRow, 1).Value = _
ws.Range("B5").Value
iRow = iRow + 1
End If
Next ws

Set wb = Nothing
Set ws = Nothing
Set wsTarget = Nothing
Exit Sub

End Sub



Click on FILE and select SAVE AS and save the file under a new name so the
original data does not mangled should things go awry.

In your newly saved copy of the original, click on TOOLS, select MACRO,
select MACROS. Select AllCellValues, if necessary, and then click the RUN
button.

This will cylce through all the workbooks

--
Kevin Backmann


"the-jackal" wrote:


What i am trying to do is copy the same cell from about 50 pages within
the same workbook into a column.

ie

Column A Names all the pages 001-50
Column B Has data from Cell B5 on every page.

I have used ='001'!B5 which works fine but i cant seem to copy it down
the list. All it changes is the cell. I want the Cell to stay the same
but the page to change.


--
the-jackal

  #3   Report Post  
Posted to microsoft.public.excel.newusers
Ken Wright
 
Posts: n/a
Default Copy the same cell from numerouse pages

Assuming your sheet names start in cell A1, then in B1 put this and then
copy down:-

=INDIRECT(A1&"!B5")

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------



"the-jackal" wrote in message
...

What i am trying to do is copy the same cell from about 50 pages within
the same workbook into a column.

ie

Column A Names all the pages 001-50
Column B Has data from Cell B5 on every page.

I have used ='001'!B5 which works fine but i cant seem to copy it down
the list. All it changes is the cell. I want the Cell to stay the same
but the page to change.


--
the-jackal



  #4   Report Post  
Junior Member
 
Location: South Woodham Ferrers, Essex
Posts: 19
Default

Thank you ever so much. This has really helped.

Thank you both.

Quote:
Originally Posted by Ken Wright
Assuming your sheet names start in cell A1, then in B1 put this and then
copy down:-

=INDIRECT(A1&"!B5")

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------



"the-jackal" wrote in message
...

What i am trying to do is copy the same cell from about 50 pages within
the same workbook into a column.

ie

Column A Names all the pages 001-50
Column B Has data from Cell B5 on every page.

I have used ='001'!B5 which works fine but i cant seem to copy it down
the list. All it changes is the cell. I want the Cell to stay the same
but the page to change.


--
the-jackal
  #5   Report Post  
Posted to microsoft.public.excel.newusers
Ken Wright
 
Posts: n/a
Default Copy the same cell from numerouse pages

You're very welcome - glad it helped, and appreciate the feedback.

Regards
Ken.................


"the-jackal" wrote in message
...

Thank you ever so much. This has really helped.

Thank you both.

Ken Wright Wrote:
Assuming your sheet names start in cell A1, then in B1 put this and
then
copy down:-

=INDIRECT(A1&"!B5")

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------



"the-jackal" wrote in message
...

What i am trying to do is copy the same cell from about 50 pages
within
the same workbook into a column.

ie

Column A Names all the pages 001-50
Column B Has data from Cell B5 on every page.

I have used ='001'!B5 which works fine but i cant seem to copy it
down
the list. All it changes is the cell. I want the Cell to stay the
same
but the page to change.


--
the-jackal



--
the-jackal



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
AUTOMATIC way to copy the value of a cell in one spreadsheet Mihalis4 Excel Worksheet Functions 2 December 2nd 05 06:49 PM
How to Copy the value of a cell to any given cell Memphis Excel Discussion (Misc queries) 4 October 21st 05 08:29 PM
how to count the number of text frequencies and copy to other cell DG Excel Worksheet Functions 1 October 6th 05 07:11 PM
hpw do I logic test a cell then copy the row to diff. SS Debi Excel Worksheet Functions 4 October 5th 05 09:42 PM
How can I copy a cell from one page to all pages of a workbook? John Q Excel Worksheet Functions 2 April 12th 05 08:32 PM


All times are GMT +1. The time now is 10:40 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"