nelsonvivar
New Member
- Joined
- Sep 30, 2016
- Messages
- 17
Hello,
I just need your help regarding my concerns too. I have a macro code that works in my laptop but not work in others laptop.
I've instructed them to check these settings in their Trust Center....
Macro Settings - check-mark the "Enable All Macros"
Macro Settings - check-mark the "Trust Access to the VBA project
object model" (whatever that is?)
Message Bar - select the "Show the Message Bar in all applications
when content has been blocked"
And still no luck.
Here are my codes. Hope you help me.
Sub GENLYPaste_Autpen()
Dim Month As String
Dim myCopy As String
Dim password As String
Month = Worksheets("Setup").Range("F8").Value
myCopy = "J2:J2041"
password = "APAccounting"
If Month = "31/01/2018" Then
With Sheets("2017TB")
.Unprotect password:=password
Worksheets("GCOA").Range("I2:I2041").Copy
If Worksheets("2017TB").Range("I2103").Value = 1 Then
MsgBox "Selected month already generated!"
Else
Worksheets("2017TB").Range("H2").PasteSpecial xlPasteValues
End If
.Protect password:=password
End With
With Sheets("2017TB")
.Unprotect password:=password
Worksheets("GCOA").Range(myCopy).Copy
If Worksheets("2017TB").Range("I2103").Value = 1 Then
MsgBox "Selected month already generated!"
Else
Worksheets("2017TB").Range("I2").PasteSpecial xlPasteValues
End If
.Protect password:=password
End With
ElseIf Month = "28/02/2018" Then
With Sheets("2017TB")
.Unprotect password:=password
Worksheets("GCOA").Range(myCopy).Copy
If Worksheets("2017TB").Range("J2103").Value = 1 Then
MsgBox "Selected month already generated!"
Else
Worksheets("2017TB").Range("J2").PasteSpecial xlPasteValues
End If
.Protect password:=password
End With
End If
Application.CutCopyMode = False
Application.Goto _
Reference:=Worksheets("TBStat").[A1]
End Sub
I just need your help regarding my concerns too. I have a macro code that works in my laptop but not work in others laptop.
I've instructed them to check these settings in their Trust Center....
Macro Settings - check-mark the "Enable All Macros"
Macro Settings - check-mark the "Trust Access to the VBA project
object model" (whatever that is?)
Message Bar - select the "Show the Message Bar in all applications
when content has been blocked"
And still no luck.
Here are my codes. Hope you help me.
Sub GENLYPaste_Autpen()
Dim Month As String
Dim myCopy As String
Dim password As String
Month = Worksheets("Setup").Range("F8").Value
myCopy = "J2:J2041"
password = "APAccounting"
If Month = "31/01/2018" Then
With Sheets("2017TB")
.Unprotect password:=password
Worksheets("GCOA").Range("I2:I2041").Copy
If Worksheets("2017TB").Range("I2103").Value = 1 Then
MsgBox "Selected month already generated!"
Else
Worksheets("2017TB").Range("H2").PasteSpecial xlPasteValues
End If
.Protect password:=password
End With
With Sheets("2017TB")
.Unprotect password:=password
Worksheets("GCOA").Range(myCopy).Copy
If Worksheets("2017TB").Range("I2103").Value = 1 Then
MsgBox "Selected month already generated!"
Else
Worksheets("2017TB").Range("I2").PasteSpecial xlPasteValues
End If
.Protect password:=password
End With
ElseIf Month = "28/02/2018" Then
With Sheets("2017TB")
.Unprotect password:=password
Worksheets("GCOA").Range(myCopy).Copy
If Worksheets("2017TB").Range("J2103").Value = 1 Then
MsgBox "Selected month already generated!"
Else
Worksheets("2017TB").Range("J2").PasteSpecial xlPasteValues
End If
.Protect password:=password
End With
End If
Application.CutCopyMode = False
Application.Goto _
Reference:=Worksheets("TBStat").[A1]
End Sub