尽管进行了多次尝试,我仍然不知道该怎么做。
我正在尝试
我有以下几点,尽管我可以实现#1,但似乎在选择正确的单元格方面遇到困难。任何帮助将不胜感激!
Dim period As String
Dim ws As Worksheet
Dim rng As Range
period = Worksheets("DB").Range("A1")
For Each ws In ThisWorkbook.Sheets
Select Case ws.Name
Case "Total", "PH4", "Product"
With ws
For Each rng In .Range("G11:Z11")
If rng.Value = period Then
'Change the data below the header into values
Range(rng.Column & "12:" & rng.Column & .Cells(Rows.Count, "C").End(xlUp).Row).Value = Value
'copy formula on the right
Range(rng.Column + 1 & "12").Copy
Range(rng.Column + 1 & "12:" & rng.Column + 1 & .Cells(Rows.Count, "C").End(xlUp).Row).PasteSpecial xlPasteFormulas
Exit For
End If
Next rng
End With
End Select
Next ws