G
Graham H
I have a procedure creating new worksheets and naming them according to a list.(Courtesy
of Debra Dalgleish's site) the relevant part of which is shown below.
What I am trying to do is to add a line where I have indicated to put the new sheet name
into cell Q1 in each new sheet. I am failing miserably in what I thought was very
straightforward. The sheet is not active so I cannot use Activesheet.name and attempts at
Range("Q1").value = c.Value fail miserably. Any help much appreciated.
Else
Set wsNew = Sheets.Add
wsNew.Move After:=Worksheets(Worksheets.Count)
wsNew.Name = c.Valuerng.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Sheet1").Range("L1:L2"), _
CopyToRange:=wsNew.Range("A1"), _
Unique:=False
End If
of Debra Dalgleish's site) the relevant part of which is shown below.
What I am trying to do is to add a line where I have indicated to put the new sheet name
into cell Q1 in each new sheet. I am failing miserably in what I thought was very
straightforward. The sheet is not active so I cannot use Activesheet.name and attempts at
Range("Q1").value = c.Value fail miserably. Any help much appreciated.
Else
Set wsNew = Sheets.Add
wsNew.Move After:=Worksheets(Worksheets.Count)
wsNew.Name = c.Valuerng.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Sheet1").Range("L1:L2"), _
CopyToRange:=wsNew.Range("A1"), _
Unique:=False
End If