View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
webels webels is offline
external usenet poster
 
Posts: 44
Default Copying same data range to a summary sheet

On May 18, 2:09*pm, "Vacuum Sealed" wrote:
Hi Eddie

I am only an intermediate myself and get regular help also, so I can say
with so certainty that to make it easier for everyone to see, it is good
practice to paste in as much of the code as possible so any anomolies can be
seen.

Hmmm, as for Excel running out of columns, more likely the problem maybe a
possible typo in the code as each sheet contains:

256 Columns x 65,536 Rows = 16,777,216 Cells.

Regards
Mick.


Thanks again Mick

Sorry for being so limited with my code the entire code is as follows,
totally Rons except for the reference.
My feeling is it may be a problem as I said running out of columns as
it looks like i will need over 300 columns

Sub Summary_All_Worksheets_With_Formulas()
Dim Sh As Worksheet
Dim Newsh As Worksheet
Dim myCell As Range
Dim ColNum As Integer
Dim RwNum As Long
Dim Basebook As Workbook

With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

'Delete the sheet "Summary-Sheet" if it exist
Application.DisplayAlerts = False
On Error Resume Next
ThisWorkbook.Worksheets("Summary-Sheet").Delete
On Error GoTo 0
Application.DisplayAlerts = True

'Add a worksheet with the name "Summary-Sheet"
Set Basebook = ThisWorkbook
Set Newsh = Basebook.Worksheets.Add
Newsh.Name = "Summary-Sheet"

'The links to the first sheet will start in row 2
RwNum = 1

For Each Sh In Basebook.Worksheets
If Sh.Name < Newsh.Name And Sh.Visible Then
ColNum = 1
RwNum = RwNum + 1
'Copy the sheet name in the A column
Newsh.Cells(RwNum, 1).Value = Sh.Name

For Each myCell In Sh.Range("C12:l40") '<--Change the
range
ColNum = ColNum + 1
Newsh.Cells(RwNum, ColNum).Formula = _
"='" & Sh.Name & "'!" & myCell.Address(False, False)
Next myCell

End If
Next Sh

Newsh.UsedRange.Columns.AutoFit

With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub


Many thanks for any help

Eddie