excelnoobhere
Board Regular
- Joined
- Mar 11, 2019
- Messages
- 61
I have the following code that looks at information from my "master" sheet then created a new sheet from "template" renames it and passes certain formation bases on content to the new template sheet.
however, the overhead tiles on the "master" are being passes over and I would like for them not to be there because i have new titles on my template.
i would also like for the information to be passes as follows
A go into B
B go into D
O go into C
how can i go about this?
Thanx in advance
however, the overhead tiles on the "master" are being passes over and I would like for them not to be there because i have new titles on my template.
i would also like for the information to be passes as follows
A go into B
B go into D
O go into C
how can i go about this?
Thanx in advance
Code:
Sub CopyToNewTempSheet()
Dim Cl As Range
Dim Uniq As String
Dim Ky As Variant
Dim Ws As Worksheet
Set Ws = Sheets("Master")
Ws.AutoFilterMode = False
With CreateObject("scripting.dictionary")
For Each Cl In Ws.Range("A3", Ws.Range("A" & Rows.Count).End(xlUp))
If IsNumeric(Left(Cl, 5)) Then
Uniq = Mid(Cl, 6, 4)
If Uniq <> "" Then .Item(Uniq) = Empty
End If
Next Cl
For Each Ky In .Keys
Ws.Range("A2:O2").AutoFilter 1, "*" & Ky & "*"
Sheets("Template").Select
Sheets("Template").copy Before:=Sheets(1)
Sheets("Template (2)").Move Before:=Sheets(1)
Sheets("Template (2)").Name = Ky
Intersect(Ws.AutoFilter.Range.EntireRow, Ws.Range("A:B,O:O")).copy Range("A6")
Next Ky
Ws.AutoFilterMode = False
End With
End Sub