MACRO submit data drop to next row upon submission
Solved/Closed
BMiller58
Posts
10
Registration date
Friday August 10, 2018
Status
Member
Last seen
October 7, 2018
-
Updated on Sep 25, 2018 at 12:15 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Aug 11, 2018 at 07:16 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Aug 11, 2018 at 07:16 PM
Related:
- MACRO submit data drop to next row upon submission
- Submit request free fire - Guide
- Saints row 2 cheats - Guide
- Tmobile data check - Guide
- We weren't able to confirm your identity from the video you submitted. you can submit a new video and we'll review it again. âś“ - Instagram Forum
- Confirm your identity problem - Facebook Forum
3 responses
We aren't you using a database? That is what a database is for. Excel is for calculations, not storing of data. If you insist on using excel, then this should get you going:
Now if you utilize with:
Function countit(WhatSheet)
Z = Cells(ThisWorkbook.Worksheets(WhatSheet).Rows.Count, 1).End(xlUp).Row
countit = Z + 1
End Function
Now if you utilize with:
nret = countit("sheet1")
MsgBox (nret & " is the next empty row")
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Aug 10, 2018 at 11:02 PM
Aug 10, 2018 at 11:02 PM
Hello BMiller58,
Upload a sample of your file to a free file sharing site such as ge.tt or Drop Box then post the link to your file back here. Make sure that the sample is an exact replica of your actual workbook and include the code that you are attempting to work with. If the data is sensitive then please use dummy data.
Just a few rows of data will suffice per sheet so that we can see what you are attempting to do.
Cheerio,
vcoolio.
Upload a sample of your file to a free file sharing site such as ge.tt or Drop Box then post the link to your file back here. Make sure that the sample is an exact replica of your actual workbook and include the code that you are attempting to work with. If the data is sensitive then please use dummy data.
Just a few rows of data will suffice per sheet so that we can see what you are attempting to do.
Cheerio,
vcoolio.
BMiller58
Posts
10
Registration date
Friday August 10, 2018
Status
Member
Last seen
October 7, 2018
Aug 11, 2018 at 12:28 AM
Aug 11, 2018 at 12:28 AM
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Aug 11, 2018 at 02:39 AM
Aug 11, 2018 at 02:39 AM
Good day Mr. Miller,
You can trim the code right down to the following:-
Remove the current code that you have assigned to the button and replace it with the above.
I have used the sheet codes instead of the sheet names in the code above.
Test it in a copy of your workbook first.
I hope that this helps.
Cheerio,
vcoolio.
You can trim the code right down to the following:-
Private Sub cbSubmit_Click() Dim ws As Worksheet: Set ws = Sheet1 Dim sh As Worksheet: Set sh = Sheet2 Application.ScreenUpdating = False ws.[B9:E9].Copy sh.Range("A" & Rows.Count).End(3)(2).PasteSpecial xlValues ws.[B9:E9].ClearContents Application.CutCopyMode = False Application.ScreenUpdating = True End Sub
Remove the current code that you have assigned to the button and replace it with the above.
I have used the sheet codes instead of the sheet names in the code above.
Test it in a copy of your workbook first.
I hope that this helps.
Cheerio,
vcoolio.
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Aug 11, 2018 at 06:54 AM
Aug 11, 2018 at 06:54 AM
Sorry to bother you again but I've just noticed the time stamp column in the destination sheet.
If you'd like this done automatically with each transfer then, in the code above, add the following line of code:-
directly after this line of code:-
The time stamp is not volatile in this instance and will remain "frozen" from the time that the transfer is completed.
I hope that this helps.
Cheerio,
vcoolio.
If you'd like this done automatically with each transfer then, in the code above, add the following line of code:-
sh.Range("E" & Rows.Count).End(3)(2) = Format(Now()) '----> Permanent time stamp.
directly after this line of code:-
sh.Range("A" & Rows.Count).End(3)(2).PasteSpecial xlValues
The time stamp is not volatile in this instance and will remain "frozen" from the time that the transfer is completed.
I hope that this helps.
Cheerio,
vcoolio.
BMiller58
Posts
10
Registration date
Friday August 10, 2018
Status
Member
Last seen
October 7, 2018
Aug 11, 2018 at 11:36 AM
Aug 11, 2018 at 11:36 AM
OMG! It works! Thank you so much vcoolio and ac3mark!
This is going to work out splendidly!
This is going to work out splendidly!
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Aug 11, 2018 at 07:16 PM
Aug 11, 2018 at 07:16 PM
You're welcome BMiller. I'm glad that we were able to help.
Cheerio,
vcoolio.
Cheerio,
vcoolio.
Aug 10, 2018 at 06:49 PM
If given the opportunity for a legitimate database, I would be all for it! Unfortunately, my organization does not share the same sentiment and would like for me develop something as a Band-Aid.
Let me try this out! :)
Aug 10, 2018 at 07:09 PM
In relation to the original code, where would these suggested lines of code need to go?
Sorry for the trouble
Aug 10, 2018 at 09:13 PM
The band aid might be quicker applied with a DB if you are having issue deploying the above code!
Give us an example of the code you are using, and let us help you out. Do you get that this is a portable function that can be called over and over for any sheet that you wish to inspect (as long as it is in the current loaded workbook)?
What error do you get? What sheet name are you passing to the function? Is your sheet named Sheet1?
Aug 10, 2018 at 09:23 PM
I have (2) Sheets; The first of which is titled "WIP_Finder", the "WIP_Finder" acts as the data source, which passes the data to the second sheet "WIP_History."
I am able to send the data from "WIP_Finder" to "WIP_History" and successfully clear the data from "WIP_Finder"; however, when I attempt to enter in new data, it wipes out my original entry in exchange for the new line of data.
If you are okay with it, I could send you the file(?) It may make a lot more sense to you