mwillerton
New Member
- Joined
- Jul 18, 2011
- Messages
- 15
Hi
I am experienced with Excel but my programming is very bad!
I have a excel 2007 workbook that records assessment grades and exam entries on multiple sheets. Each sheet is named according to class group. I want some VBA code that will read the sheet names, collate them to a new sheet and extract data from specific cells in each sheet and record it in the newly created sheet in new columns.
I have found this code that creates sheets, however it records it in a single set of cells.
Sub Macro1a()
Dim SecStat As Worksheet
Dim R As Long
Dim strName As String
Dim Wks As Worksheet
'Add the sheet if needed or use the existing one.
On Error Resume Next
Set SecStat = Worksheets("Section Statistics")
If Err > 0 Then
Set SecStat = Worksheets.add(After:=Worksheets(Worksheets.Count))
ActiveSheet.Name = "Section Statistics"
R = 1
Else
R = SecStat.UsedRange.Rows.Count
End If
On Error GoTo 0
For Each Wks In Worksheets
If Wks.Name <> SecStat.Name Then
strName = Wks.Name & Wks.Range("D34")
SecStat.Range("A1").Offset(R, 0) = strName
R = R + 1
End If
Next Wks
End Sub
This only collates sheet names and records a single cell. I need to select data from multiple cells and record in the sheet.
I have added in the sheets i am working on
Your Download-Link:FS Tracking Sheet MW Version 1.0.xlsm
http://www.megafileupload.com/en/file/320295/FS-Tracking-Sheet-MW-Version-1-0-xlsm.html
Thanks for help
Matt
I am experienced with Excel but my programming is very bad!
I have a excel 2007 workbook that records assessment grades and exam entries on multiple sheets. Each sheet is named according to class group. I want some VBA code that will read the sheet names, collate them to a new sheet and extract data from specific cells in each sheet and record it in the newly created sheet in new columns.
I have found this code that creates sheets, however it records it in a single set of cells.
Sub Macro1a()
Dim SecStat As Worksheet
Dim R As Long
Dim strName As String
Dim Wks As Worksheet
'Add the sheet if needed or use the existing one.
On Error Resume Next
Set SecStat = Worksheets("Section Statistics")
If Err > 0 Then
Set SecStat = Worksheets.add(After:=Worksheets(Worksheets.Count))
ActiveSheet.Name = "Section Statistics"
R = 1
Else
R = SecStat.UsedRange.Rows.Count
End If
On Error GoTo 0
For Each Wks In Worksheets
If Wks.Name <> SecStat.Name Then
strName = Wks.Name & Wks.Range("D34")
SecStat.Range("A1").Offset(R, 0) = strName
R = R + 1
End If
Next Wks
End Sub
This only collates sheet names and records a single cell. I need to select data from multiple cells and record in the sheet.
I have added in the sheets i am working on
Your Download-Link:FS Tracking Sheet MW Version 1.0.xlsm
http://www.megafileupload.com/en/file/320295/FS-Tracking-Sheet-MW-Version-1-0-xlsm.html
Thanks for help
Matt
Last edited: