Copy a range of data to all sheets of the workbook

后端 未结 2 780
终归单人心
终归单人心 2021-01-27 13:47

I have a workbook that contains a database .

On that database there is a certain row of data that i would like to copy and paste to all sheets.

The copying ra

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-27 14:30

    do you need a Loop for all worksheets ?

        Dim ws as Worksheet
        For Each ws in ActiveWorkbook.Worksheets
            If Not ws.Name = "*Name of the database workbook *" Then    
                Call ws.Range("B1:N1").PasteSpecial(xlPasteAll, xlPasteSpecialOperationNone)
            End If
        Next
    

提交回复
热议问题