activecell.paste error

agus setiawan

New Member
Joined
Oct 21, 2020
Messages
3
Office Version
  1. 365
hey i just try to learn excel more deep and it fun, i make my own data for my little store but i got trouble in this coding
VBA Code:
Sub SimpanData()

Sheets("TRANSAKSI KASIR").Select
Range("C8:L8").Offset(1, 0).Select                    
If Range("E6") = 1 Then                           
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Else
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
End If
Selection.Copy


ThisWorkbook.Worksheets("DAFTAR TRANSAKSI").Visible = xlSheetVisible
Worksheets("DAFTAR TRANSAKSI").Unprotect Password:="1234"
Sheets("DAFTAR TRANSAKSI").Select
If Range("B3").Offset(1, 0).Value = "" Then        
Range("B3").Offset(1, 0).Select
Else
Range("B3").End(xlDown).Offset(1, 0).Select
End If


ActiveCell.PasteSpecial            >>>>>> this the trouble maker


    Application.CutCopyMode = False
Worksheets("DAFTAR TRANSAKSI").Protect Password:="1234", UserInterfaceOnly:=True
ThisWorkbook.Worksheets("DAFTAR TRANSAKSI").Visible = xlSheetHidden

End Sub
 
Last edited by a moderator:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
What is the error?
 
Upvote 0
VBA Code:
Activecell.PasteSpecial ...

Should be
VBA Code:
Selection.PasteSpecial ...
 
Last edited:
Upvote 0
If it 'makes an error', you must know what the error message is.
 
Upvote 0
Example
VBA Code:
Selection.PasteSpecial Paste:=xlPasteValues
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,699
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top