|
各位大神帮忙看下,标红部分要怎么改才可以只复制数值,而不是公式和格式都复制过来,谢谢!
Private Sub CommandButton1_Click()
bk = MsgBox("是否获取数据?", vbYesNo, "提示")
If bk = vbNo Then Exit Sub
Range("C5:O16,C23:O28,C47:O52,C54:O59,C61:O66,C68:O73,C75:O80,C83:O88").ClearContents
Dim wb As Workbook
ph = Application.GetOpenFilename
Application.ScreenUpdating = False
If ph = False Then Exit Sub
Set wb = Workbooks.Open(ph)
Application.ScreenUpdating = True
Set sh1 = wb.Sheets("应收逾期&周转-不含德龙")
Set sh2 = wb.Sheets("应收逾期&周转-内销品牌")
sh1.Range("C18:O18").Copy Range("C5:O5")
sh1.Range("C19:O19").Copy Range("C11:O11")
sh1.Range("C21:O21").Copy Range("C23:O23")
sh2.Range("C18:O18").Copy Range("C6:O6")
sh2.Range("C19:O19").Copy Range("C12:O12")
sh2.Range("C21:O21").Copy Range("C24:O24")
wb.Close False
MsgBox "OK"
End Sub
|
|