Board logo

標題: [發問] VBA 貼上值與數字格式 [打印本頁]

作者: missbb    時間: 2015-8-20 14:35     標題: VBA 貼上值與數字格式

請問大大可以甚樣貼上值與數字格式, 試了PASTE SPECIAL PASTLE VALUE等語法會變成空白????

求教

Sub Combineshop_together()

Dim J As Integer
Worksheets("shop summary").Activate
Worksheets("shop summary").UsedRange.Select
Selection.Clear
On Error Resume Next
Sheets("shop summary").Select
For J = 7 To Sheets.Count
Sheets(J).Activate
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Offset(0, 0).Resize(Selection.Rows.Count - 1).Select
Selection.Copy Destination:=Sheets("shop summary").Range("A65536").End(xlUp)(2)



Next
End Sub
作者: ikboy    時間: 2015-8-20 19:01

Sub Combineshop_together()

Dim J As Integer
'Worksheets("shop summary").Activate
Worksheets("shop summary").UsedRange.Clear
'Selection.Clear
On Error Resume Next
'Sheets("shop summary").Select
For J = 7 To Sheets.Count
Sheets(J).Activate
Range("A1").CurrentRegion.Select
Selection.Offset(0, 0).Resize(Selection.Rows.Count - 1).Copy
'Selection.Copy Destination:=Sheets("shop summary").Range("A65536").End(xlUp)(2)
Sheets("shop summary").Range("A65536").End(xlUp)(2).PasteSpecial xlPasteValuesAndNumberFormats


Next
End Sub
作者: missbb    時間: 2015-8-20 22:08

回復 2# ikboy


    感謝賜教!




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)