Force “F2”+“Enter” on range of cells

后端 未结 12 1819
伪装坚强ぢ
伪装坚强ぢ 2021-01-04 05:31

I have an Excel 2010 worksheet which has macros to copy data from other sheets into a specific format on another sheet.

The data copies but I have an issue with the

12条回答
  •  不知归路
    2021-01-04 06:06

    Sub RefreshCells()
    
    Dim r As Range, rr As Range
    Set rr = Selection
    For Each r In rr
    r.Select
    Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
       Application.CutCopyMode = False
    
        Application.SendKeys "{F2}"
        Application.SendKeys "{ENTER}"
        Application.SendKeys "+{ENTER}"
        DoEvents
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
       Application.CutCopyMode = False
    
        Application.SendKeys "{ENTER}"
    
        DoEvents
    
    Next
    
    
    
    End Sub
    

提交回复
热议问题