Vba macro

mamtasarkar

New Member
Joined
Oct 28, 2021
Messages
16
Office Version
  1. 2010
Platform
  1. Windows
Hello,
Someone guide me, i create stock inventory management with two userforms for inward and outward and four sheets for opening stock, inward stock, outward and net stock with A:G rows A stands for items , B= MAKE, C= GRADE, D= OPSTOCK Quantity, E= Inward qty, F= outward and G= bal.quantity, i execute formula for import qty from op, inward and outward but i can't import items, make and grade rows without repeating from opening stock sheet and from inward sheet, please guide me how can i call three rows from two sheets
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Your question is not really clear to me.
I am assuming you want to enter something in say the INWARD userform. This then should modify the status of the four sheets, opening,inward outward and net. Is that what your problem is?

Else please try to explain in a different way, such as: If I do this, then that, such and so should happen on these sheets and those cells.
 
Upvote 0
Your question is not really clear to me.
I am assuming you want to enter something in say the INWARD userform. This then should modify the status of the four sheets, opening,inward outward and net. Is that what your problem is?

Else please try to explain in a different way, such as: If I do this, then that, such and so should happen on these sheets and those
 

Attachments

  • opstock sheet.png
    opstock sheet.png
    163.5 KB · Views: 9
  • inwardsheet.png
    inwardsheet.png
    164.8 KB · Views: 9
  • outwardsheet.png
    outwardsheet.png
    160.6 KB · Views: 8
  • net stock sheet.png
    net stock sheet.png
    167.7 KB · Views: 9
Upvote 0
I need help for new inward stock move to net stock inventory sheet without repeat and opening stock is already moved in net stock sheet
 
Upvote 0
OK. So when you enter stock on inward sheet, and press the button, this should move to the net stock sheet, adding to any existing stock, and clearing the inward sheet.
 
Upvote 0
I am quite busy at the moment, but will try to work on this in between.
 
Upvote 0
I run macro userform for inward stock and adding data on same inward sheet table i tried to vlookup formula for items, brand, grade column from opening sheet and inward sheet into net stock sheet but i failed to use vlookup for three columns.
 
Upvote 0
How to vlookup items from two sheets into another without repeat ìtems
 
Upvote 0
When using vba, you don't need to do Vlookup. Th macro I will write checks the net stock table for each item in the inward table. If exists, it will add to the line, if it is a new item it will be added to the bottom of the net table.
 
Upvote 0
When using vba, you don't need to do Vlookup. Th macro I will write checks the net stock table for each item in the inward table. If exists, it will add to the line, if it is a new item it will be added to the bottom of the net table.
userform 1
code:

Private Sub cmdadd_Click()
Dim RowCount As Long
Dim f As Integer
For f = 1 To 8

RowCount = Worksheets("Inwards").Range("A1").CurrentRegion.Rows.Count
With Worksheets("Inwards").Range("A1")
.Offset(RowCount, 0) = Controls("txt" & f).Value
.Offset(RowCount, 1) = Controls("txtt" & f).Value
.Offset(RowCount, 2) = Controls("txttt" & f).Value
.Offset(RowCount, 3) = Controls("txtttt" & f).Value
.Offset(RowCount, 4) = Controls("txttttt" & f).Value
End With
Controls("txt" & f).Value = ""
Controls("txtt" & f).Value = ""
Controls("txttt" & f).Value = ""
Controls("txtttt" & f).Value = ""
Controls("txttttt" & f).Value = ""
Next f


End Sub

Private Sub cmdclr_Click()
Dim a As Integer
For a = 1 To 8
Controls("txt" & a).Value = ""
Controls("txtt" & a).Value = ""
Controls("txttt" & a).Value = ""
Controls("txtttt" & a).Value = ""
Controls("txttttt" & a).Value = ""
txt1.SetFocus
Next a
End Sub

Private Sub cmdcls_Click()
Unload Me
End Sub

Private Sub UserForm_Click()

End Sub

Userform2
code:

Private Sub cmdadd_Click()
Dim RowCount As Long
Dim f As Integer
For f = 1 To 10

RowCount = Worksheets("Outwards").Range("A1").CurrentRegion.Rows.Count
With Worksheets("Outwards").Range("A1")
.Offset(RowCount, 0) = Controls("txt" & f).Value
.Offset(RowCount, 1) = Controls("txtt" & f).Value
.Offset(RowCount, 2) = Controls("txttt" & f).Value
.Offset(RowCount, 3) = Controls("txtttt" & f).Value
.Offset(RowCount, 4) = Controls("txttttt" & f).Value
End With

Controls("txt" & f).Value = ""
Controls("txtt" & f).Value = ""
Controls("txttt" & f).Value = ""
Controls("txtttt" & f).Value = ""
Controls("txttttt" & f).Value = ""
Next f
End Sub

Private Sub cmdclr_Click()
Dim a As Integer
For a = 1 To 10
Controls("txt" & a).Value = ""
Controls("txtt" & a).Value = ""
Controls("txttt" & a).Value = ""
Controls("txtttt" & a).Value = ""
Controls("txttttt" & a).Value = ""
txt1.SetFocus
Next a
End Sub

Private Sub cmdcls_Click()
Unload Me
End Sub

Private Sub UserForm_Click()

End Sub

i want to move data from opening stock sheet & inward sheet into net stock inventory, qty is automatic calculated by function in net stock
 

Attachments

  • userform1.png
    userform1.png
    171 KB · Views: 9
  • userform2.png
    userform2.png
    162.1 KB · Views: 9
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,521
Members
449,088
Latest member
RandomExceller01

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