Hi Everyone, Happy New year to all Great ones.
Please help in achieving my task, I have tried to some macros and some vba code to do some work in this workbook, actually I have prepared this excel for stock and inventory management as per our requirement. In this workbook user can do following task:-
1. first select entry type, either purchase or stock out from dropdown list
2. do entries and press on purchase or stock out shape accordingly. If press purchase then automatically data will go on purchase sheet and save it and return back to home sheet for new entry and so on for same as stock out also.
3. macro should automatically save data after each entry.
4. user can navigate in every sheet, but all sheets should be password protected to avoid any manipulation.
5. and if any cell in Home sheet is blank as per purchase or stock out criteria then macro should not run and throw message for either purchase or stock out.
But still I am getting errors and not able to achieve the task.
Each sheets password is 123 and VBA project password is 1236.
Any help is highly appreciated. Thanks a lot!
Some codes and macros which I have tried
In home sheet, for hidding the sheets and for combobox
Usings shapes, tried to navigate between all sheets.
[/CODE]
and macros to copy and paste the data in hidden and protected sheets
This is the file link where you can see the full file
STATIONARY INVENTORY AND STOCK.xlsm
Please help in achieving my task, I have tried to some macros and some vba code to do some work in this workbook, actually I have prepared this excel for stock and inventory management as per our requirement. In this workbook user can do following task:-
1. first select entry type, either purchase or stock out from dropdown list
2. do entries and press on purchase or stock out shape accordingly. If press purchase then automatically data will go on purchase sheet and save it and return back to home sheet for new entry and so on for same as stock out also.
3. macro should automatically save data after each entry.
4. user can navigate in every sheet, but all sheets should be password protected to avoid any manipulation.
5. and if any cell in Home sheet is blank as per purchase or stock out criteria then macro should not run and throw message for either purchase or stock out.
But still I am getting errors and not able to achieve the task.
Each sheets password is 123 and VBA project password is 1236.
Any help is highly appreciated. Thanks a lot!
Some codes and macros which I have tried
In home sheet, for hidding the sheets and for combobox
VBA Code:
Private Sub ComboBox2_GotFocus()
ComboBox2.ListFillRange = "DropDownList"
ComboBox2.DropDown
End Sub
Private Sub Worksheet_Activate()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Sheets
If ActiveSheet.Name <> ws.Name Then
ws.Visible = False
End If
Next ws
End Sub
Usings shapes, tried to navigate between all sheets.
VBA Code:
[CODE=xls]
Sub JumpToSheet()
Dim shp As Shape
Set shp = ActiveSheet.Shapes(Application.Caller)
With Worksheets(shp.Name)
.Visible = True
.Select
End With
End Sub
and macros to copy and paste the data in hidden and protected sheets
VBA Code:
Sub pur()
'
' pur Macro
'
'
Range("E10:E14").Select
Sheets("HOME").Select
Sheets("PURCHASE").Visible = True
ActiveSheet.Unprotect
Sheets("HOME").Select
Selection.Copy
Sheets("HOME").Select
Sheets("PURCHASE").Visible = True
Range("A5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("A5").Select
Application.CutCopyMode = False
Selection.ListObject.ListRows.Add (1)
Range("A5").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("HOME").Select
Selection.ClearContents
Range("E10").Select
ActiveWorkbook.Save
End Sub
Sub stout()
'
' stout Macro
'
'
Range("E10:E13").Select
Sheets("HOME").Select
Sheets("STOCK OUT").Visible = True
ActiveSheet.Unprotect
Range("A5").Select
Sheets("HOME").Select
Selection.Copy
Sheets("HOME").Select
Sheets("STOCK OUT").Visible = True
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("A5").Select
Application.CutCopyMode = False
Selection.ListObject.ListRows.Add (1)
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("HOME").Select
Selection.ClearContents
Range("E10").Select
ActiveWorkbook.Save
End Sub
This is the file link where you can see the full file
STATIONARY INVENTORY AND STOCK.xlsm