VBA Submission form

MrRosco

New Member
Joined
May 12, 2016
Messages
47
Hi Everyone

Im in need of some help with the document im working on. Ive created a submission form which will populate a hidden database

i need the code to copy data from the form to specific cell in the database
the table below gives the corresponding cells to the columns in the database.

the document will have no limit on the number of rows, i need it to find the next available row for it to populate then clear the submission
form when done, ready for the next entry.

One sticking point is that i need it to block saving it if code 609110 is used and no text has been inputted into cell F11

any help on this will be greatly appreciated :eek:

**THE DATABASE STARTS FROM ROW 6**


FORM "SG&A Submission"DATABASE "SG&A Tracker"
A7F
C7J
A11K
E7N
E11R
E14S
F11U

<tbody>
</tbody>
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Untested,

try this on a copy of file:

Code:
Sub do_it()
Dim rs As Worksheet

Set rs = Worksheets("SG&A Tracker")

If Range("F11") = "" Then
    MsgBox "Cell F11 is empty"
    Exit Sub
End If

lr = rs.Range("A" & Rows.Count).End(xlUp).Row + 1

rs.Cells(r, "F") = Range("A7")
rs.Cells(r, "J") = Range("C7")
rs.Cells(r, "K") = Range("A11")
rs.Cells(r, "N") = Range("E7")
rs.Cells(r, "R") = Range("E11")
rs.Cells(r, "S") = Range("E14")
rs.Cells(r, "U") = Range("F11")

Range("A7").ClearContents
Range("C7").ClearContents
Range("A11").ClearContents
Range("E7").ClearContents
Range("E11").ClearContents
Range("E14").ClearContents
Range("F11").ClearContents


End Sub

hth,

Ross
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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