Update: I was able to solve this problem. I just remembered VBA use * and ? to present the string 'If Sheet.name Like "*CopyA"'
I would like to make a copy special value with original format of the sources of all sheets contains the word: "CopyA" for example "Apple CopyA","Mango CopyA"
I can use the macro record to see how VBA create sheet and copy special like similar example below.
I am having trouble in the searching for sheet name - All examples I found either I must know exact name (same as Macro record) or I have to make a copy of all sheets (loop though all sheet and copy, no matter the name is).
Sub Macro1()
Sheets("Sheet1").Select
Sheets("Sheet1").Copy Before:=Sheets(1)
Sheets("Sheet1(2)").Select
Cells.Select
Selection.Copy
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
How can I search for sheet's name? In this case, any sheet that has "CopyA"?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…