Auto create info sheets from master spreadsheet
Solved/Closed
wbarn17
Posts
2
Registration date
Thursday April 12, 2018
Status
Member
Last seen
April 16, 2018
-
Updated on Apr 13, 2018 at 08:52 AM
Blocked Profile - Apr 16, 2018 at 04:59 PM
Blocked Profile - Apr 16, 2018 at 04:59 PM
Related:
- Auto create info sheets from master spreadsheet
- Master royale - Download - Strategy
- Grand theft auto v free download no verification for pc - Download - Action and adventure
- How to stop facebook from auto refreshing - Guide
- Yu-gi-oh master duel download pc without steam - Download - Strategy
- Create skype account with gmail - Guide
1 response
OK, when you say "ALL of the data", why cant you just cut line 2, create sheet2, paste line 2. Is there some fancy formatting you wish to have when "filling in" in the sheet?
Try this, use the below code as an example, and make do what you are asking:
Try this, use the below code as an example, and make do what you are asking:
Function CountRows(WhatSheet)
Dim cellcount
cellcount = 0
ThisWorkbook.Worksheets(WhatSheet).Select
cellcount = Cells(ThisWorkbook.Worksheets(WhatSheet).Rows.Count, 1).End(xlUp).Row
CountRows = cellcount
End Function
Sub PasteToSheet(WhatSheet)
Dim tmpRow
tmpRow = CountRows(WhatSheet)
ThisWorkbook.Worksheets(WhatSheet).Select
Cells(tmpRow, 1).EntireRow.Select
Selection.Insert
Application.CutCopyMode = False
End Sub
Function SheetToSheet(FromWhatSheet, FromWhatRow, ToWhatSheet)
Dim tmpCellValue
tmpCellValue = ""
ThisWorkbook.Worksheets(FromWhatSheet).Select
ActiveSheet.Range("A" & FromWhatRow).EntireRow.Select
Selection.Copy
PasteToSheet (ToWhatSheet)
End Function
Function CheckIfIsSheet(SheetName) As Boolean
CheckIfIsSheet = False
For Each ws In Worksheets
If SheetName = ws.Name Then
CheckIfIsSheet = True
Exit Function
End If
Next ws
End Function
Private Sub CreateTheSheet(NamedWhat)
Dim Works As Worksheet
With ThisWorkbook
Set Works = .Sheets.Add(After:=.Sheets(.Sheets.Count))
Works.Name = NamedWhat
End With
End Sub
Sub CreateBook(WhatSheet)
Dim Mainsheet
Dim RowCount
Dim CurrentRow
Dim StartingRow
Dim WhatRow
Dim CellValue
Dim CellToCheck
Dim sheetTAB As Worksheet
StartingRow = 2 'Change this value to whatever row your master sheet starts on
Mainsheet = WhatSheet
ThisWorkbook.Worksheets(Mainsheet).Select
RowCount = CountRows(Mainsheet)
' MsgBox (RowCount) 'unREM for Feedback
'Now need to check if there is any info on the master sheet
If CurrentRow > RowCount Then
MsgBox ("No Entries on Worksheet " & Mainsheet & ". Now closing!")
'Upon finding no info, it closes
Exit Sub
End If
'Now we need ot loop through each line and see if we have a worksheet
For CurrentRow = StartingRow To RowCount
CellToCheck = "B" & CurrentRow
CellValue = ThisWorkbook.Worksheets(Mainsheet).Range(CellToCheck).Value
MsgBox (CellValue) 'unREM for feedback
'need to see if the tab exist, if not create it
doesSheetExist = CheckIfIsSheet(CellValue)
MsgBox (doesSheetExist)
If doesSheetExist = False Then
CreateTheSheet (CellValue)
End If
nret = SheetToSheet(Mainsheet, CurrentRow, CellValue)
ThisWorkbook.Worksheets(Mainsheet).Select
Next
End Sub
Apr 16, 2018 at 12:24 PM
Apr 16, 2018 at 04:59 PM