Create multiple worksheets and automatically enter data from list

LeilaniMerle

New Member
Joined
Jan 26, 2014
Messages
22
Hi,

I have a list in my Excel spreadsheet, and a template that I use to generate student Names, Surnames, Student Numbers and I.D.S. How would I get the relevant information into the correct cells and automatically create the worksheets, and possibly rename the worksheet to the Student Number.

P.S. I have blanked out I.D. Numbers and the names are fictitious for the purpose of confidentiality.
list.PNG
Worksheet.PNG


Thank you for any assistance..
Kind regards

Merle Tait
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
What is the name of the worksheet containing your data and what is the name of the sheet containing the template? What are the cells addresses of the student number, ID number, first name and last name in the template?
 
Upvote 0
How about something like
VBA Code:
Sub LeilaniMerle()
   Dim Cl As Range
   
   With Sheets("Sheet1")
      For Each Cl In .Range("A2", .Range("A" & Rows.Count).End(xlUp))
         If Not Evaluate("isref('" & Cl.Value & "'!A1)") Then
            Sheets("Template").Copy , Sheets(Sheets.Count)
            ActiveSheet.Name = Cl.Value
            Range("C3") = Cl.Value
            Range("C5") = Cl.Offset(, 1).Value
            Range("F5") = Cl.Offset(, 2).Value
            Range("F4") = Cl.Offset(, 3).Value
         End If
      Next Cl
   End With
End Sub
Change sheet names & ranges to suit
 
Upvote 0
What is the name of the worksheet containing your data and what is the name of the sheet containing the template? What are the cells addresses of the student number, ID number, first name and last name in the template?
Hi Mumps, thanks for response. 2020-NSP-0003 Is the template which needs to be recreated. Student Number C3 , First Name C5, ID Number F4, Last Name F5.
 
Upvote 0
Hi Mumps, thanks for response. 2020-NSP-0003 Is the template which needs to be recreated. Student Number C3 , First Name C5, ID Number F4, Last Name F5.
How about something like
VBA Code:
Sub LeilaniMerle()
   Dim Cl As Range
  
   With Sheets("Sheet1")
      For Each Cl In .Range("A2", .Range("A" & Rows.Count).End(xlUp))
         If Not Evaluate("isref('" & Cl.Value & "'!A1)") Then
            Sheets("Template").Copy , Sheets(Sheets.Count)
            ActiveSheet.Name = Cl.Value
            Range("C3") = Cl.Value
            Range("C5") = Cl.Offset(, 1).Value
            Range("F5") = Cl.Offset(, 2).Value
            Range("F4") = Cl.Offset(, 3).Value
         End If
      Next Cl
   End With
End Sub
Change sheet names & ranges to suit
Will give it a try, thank you Fluff.
 
Upvote 0
Ok, let us know how it goes :)
 
Upvote 0
Greetings,

I would like to try this question again please if I may? I was not sure how the VBA script works.

I have a list of Students consisting as follows: Student Number etc. please see image Student List
Then I have a template. Please see image Template.
I have two scenarios I need to complete here.

1. Create multiple worksheets from the template and naming them using the Student Number. e.g. 2020-NSP-0003
2. On the new worksheets I need to have : Student Number in cell C3 / First Name in cell C5 / Surname in Cell F5 / ID Number in Cell F4
in sequence from the Student List.

Please assist. I have thousands of transcript to do
 

Attachments

  • Student List.PNG
    Student List.PNG
    43.4 KB · Views: 1
  • Template.PNG
    Template.PNG
    90.9 KB · Views: 1
Upvote 0
That's exactly what the macro does :)
 
Upvote 0
No it will create a new sheet for every value in col A. Why not try it ;)
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top