Jagat Pavasia
Active Member
- Joined
- Mar 9, 2015
- Messages
- 359
- Office Version
- 2021
- Platform
- Windows
hi, dear sir,
I have many VBA code in my worksheet, now i want to share my workbook for 2 Computer. So, the both computer can work on workbook at the same time.
but when i share it, some of VBA code stopped working, any other idea to share workbook with VBA code ?
Please suggest me. My VBA code is Something like below.
I have many VBA code in my worksheet, now i want to share my workbook for 2 Computer. So, the both computer can work on workbook at the same time.
but when i share it, some of VBA code stopped working, any other idea to share workbook with VBA code ?
Please suggest me. My VBA code is Something like below.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
' Code goes in the Worksheet specific module
Dim rng As Range
' Set Target Range, i.e. Range("A1, B2, C3"), or Range("A1:B3")
Set rng = Target.Parent.Range("b:b,f:f,m:m")
' Only look at single cell changes
If Target.Count > 1 Then Exit Sub
' Only look at that range
If Intersect(Target, rng) Is Nothing Then Exit Sub
' Action if Condition(s) are met (do your thing here...)
If Target.Value = "**" Then Target.Value = Format(Date, "mm/dd/yyyy")
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = True
End Sub
Sub ClearAllFilter()
'
' ClearAllFilter Macro
'
'
ActiveSheet.Unprotect
On Error Resume Next
ActiveSheet.ShowAllData
On Error GoTo 0
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFiltering:=True
End Sub
Private Sub SpinButton1_SpinDown()
On Error Resume Next
Range("b6").Value = Range("b6").Value - 1
End Sub
Private Sub SpinButton1_SpinUp()
On Error Resume Next
Range("b6").Value = Range("b6").Value + 1
End Sub
Sub GhatJama()
'
' GhatJama Macro
'
'
ActiveSheet.Unprotect
On Error Resume Next
ActiveSheet.ShowAllData
ActiveSheet.Range("$A$5:$R$9000").AutoFilter Field:=6, Criteria1:="<>"
ActiveSheet.Range("$A$5:$R$9000").AutoFilter Field:=13, Criteria1:="="
On Error GoTo 0
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFiltering:=True
End Sub