Dears members.
I am from Belgium and my English is not fantastic, but i wil try to explain my problem.
I have on sheet 1 ( "Master") a list with numbers in colum A, in colum A to AB i have every cell filled with info.
Sheet 2 ( "Checklist") i have a template .
So, i try this vba code i find here on the site.
What i want to do :
- make sheet from every number in sheet 1 colum A
- make hyperlink from every number in sheet 1 colum A
- copy template in every maked sheet
So far so good with this code, but ...
- i can not copy the info in Sheet 1 (Range A to AB ) in every maked sheet
- I can not make my colum autosized ( every cell is diferent )
- I can not make a security, if the sheet already excist , he do not make a new sheet or overide it.
This is de code at this moment :
Option Explicit
Sub CreateAndNameWorksheets()
Dim c As Range
Application.ScreenUpdating = False
Sheets("Master").Select
For Each c In Sheets("Master").Range("A2:A" & Sheets("Master").Range("A" & Rows.Count).End(xlUp).Row)
c.Select
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = c.Value
Sheets("Checklist").Cells.Copy
ActiveSheet.Paste
Range("A10").Select
Application.CutCopyMode = False
'maken van Hyperlink in Master
Sheets("Master").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:=c.Value & "!A2", TextToDisplay:=c.Value
Next c
Application.ScreenUpdating = True
End Sub
Can somebody help me out ?
Thx !!
regards, Phil
I am from Belgium and my English is not fantastic, but i wil try to explain my problem.
I have on sheet 1 ( "Master") a list with numbers in colum A, in colum A to AB i have every cell filled with info.
Sheet 2 ( "Checklist") i have a template .
So, i try this vba code i find here on the site.
What i want to do :
- make sheet from every number in sheet 1 colum A
- make hyperlink from every number in sheet 1 colum A
- copy template in every maked sheet
So far so good with this code, but ...
- i can not copy the info in Sheet 1 (Range A to AB ) in every maked sheet
- I can not make my colum autosized ( every cell is diferent )
- I can not make a security, if the sheet already excist , he do not make a new sheet or overide it.
This is de code at this moment :
Option Explicit
Sub CreateAndNameWorksheets()
Dim c As Range
Application.ScreenUpdating = False
Sheets("Master").Select
For Each c In Sheets("Master").Range("A2:A" & Sheets("Master").Range("A" & Rows.Count).End(xlUp).Row)
c.Select
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = c.Value
Sheets("Checklist").Cells.Copy
ActiveSheet.Paste
Range("A10").Select
Application.CutCopyMode = False
'maken van Hyperlink in Master
Sheets("Master").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:=c.Value & "!A2", TextToDisplay:=c.Value
Next c
Application.ScreenUpdating = True
End Sub
Can somebody help me out ?
Thx !!
regards, Phil