对于知道的人来说这可能很快,所以我将不胜感激任何帮助...
我有这个代码:
Dim shtSource As Worksheet
Dim shtDestination As Worksheet
Dim nSourceRow As Long, nDestRow As Long
Set shtSource = Sheets("Forecast Opex")
Set shtDestination = Sheets("Opex Pers Sala Admi")
nSourceRow = 46
For nDestRow = 2 To 97
shtDestination.Cells(nDestRow, 3) = shtSource.Cells(nSourceRow, 2).Value 'NewForecast
nSourceRow = nSourceRow + 1
Next nDestRow
...并且工作得很好...问题是我需要根据位于另一个单元格(例如 H5)中的名称更改名为“Opex Pers Sala Admi”的工作表。该单元格中的内容根据指示要使用广告目标的工作表的某些条件而有所不同。
谢谢
来自评论的更新
Sub Update_Click()
Dim shtSource As Worksheet
Dim shtDestination As Worksheet
Dim nSourceRow As Long, nDestRow As Long
Set shtSource = Sheets("Base")
Set shtDestination = Sheets(Sheets("Base").Range("L21"))
'...
End Sub