VBA: Submit Specific Data to another excel

Xlacs

Board Regular
Joined
Mar 31, 2021
Messages
105
Office Version
  1. 2016
Platform
  1. Windows
Hi Everyone,

I am kinda new to this VBA programming so I am wondering if someone could help me with this simple problem.

So I have a time and motion study tracker with start, end and submit button button. I managed to worked on start and end.

But I am struggling to submit an specific data to my masterfile. In my workbook. I have a dropdown selection of status.. If the value of the dropdown is Pending, then those
cases should be submitted in my masterfile when I hit the Submit button and status in my last column will be updated to SUbmitted. So it will exclude those cases on my next submission..



PS: I have not yet created a Masterfile.. This one is my raw data..

Hoping someone could actually help me thru this.. Thank you Guys!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Update.

Below is my current code

VBA Code:
Dim r As Long, lr As Long, Archive As Workbook

r = 2
lr = Cells(Rows.Count, 1).End(xlUp).Row

Set Archive = Workbooks.Open("C:\Users\ChrisLacs\Desktop\Test\Archive.xlsm")

Do Until r = lr + 2

If Cells(r, 4) = "" Then
Range(Cells(r, 1), Cells(r, 3)).Copy
Archive.Worksheets("Prod").Select

erow = Archive.Worksheets("Prod").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

ActiveSheet.Paste Destination:=Archive.Worksheets("Prod").Rows(erow)

   
End If

r = r + 1

Loop

Archive.Close

End Sub
 
Upvote 0
belows is my current code =(

VBA Code:
Sub Submit()

Dim STunsent As String
Dim OA As Object
Dim msg As Object
Dim sh As Worksheet

Dim Outapp As Object, Logfile As String


sh = ThisWorkbook.Sheets("Prod")

Dim x As Integer
Dim lastrow As Integer

lastrow = Application.WorksheetFunction.CountBlank(sh.Range("D:D"))

For x = 2 To lastrow

If sh.Range("O" & i).Value <> "Submitted" And sh.Range("J" & i).Value = "Pending" Then




End Sub
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

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