Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Submit()
- Dim sh As Worksheet
- Dim ds As Worksheet
- Dim iRow As Long
- Set sh = Sheets("Form")
- Set ds = Sheets("Database")
- iRow = ds.Range("A" & ds.Rows.Count).End(xlUp).Offset(1).Row
- Sheet2.Unprotect "12345"
- ds.Cells(iRow, 1) = iRow - 1
- ds.Cells(iRow, 2).Value = sh.Range("AS4").Value
- ds.Cells(iRow, 3).Value = sh.Range("AS5").Value
- ds.Cells(iRow, 4).Value = sh.Range("AS6").Value
- ds.Cells(iRow, 5).Value = sh.Range("AS7").Value
- ds.Cells(iRow, 6).Value = sh.Range("AS8").Value
- ds.Cells(iRow, 7).Value = sh.Range("AS9").Value
- ds.Cells(iRow, 8).Value = sh.Range("AS10").Value
- ds.Cells(iRow, 9).Value = sh.Range("AS11").Value
- ds.Cells(iRow, 10).Value = sh.Range("AS12").Value
- ds.Cells(iRow, 11).Value = sh.Range("AS13").Value
- ds.Cells(iRow, 12).Value = sh.Range("AS14").Value
- ds.Cells(iRow, 13).Value = sh.Range("AS15").Value
- ds.Cells(iRow, 14).Value = sh.Range("AS16").Value
- ds.Cells(iRow, 15).Value = Application.UserName
- ds.Cells(iRow, 16).Value = [Text(now(), "MM-DD-YYYY HH:MM:SS")]
- sh.Range("F4").Value = ""
- sh.Range("F6").Value = ""
- sh.Range("F8").Value = ""
- sh.Range("F10").Value = ""
- sh.Range("F12").Value = ""
- sh.Range("F14").Value = ""
- sh.Range("F16").Value = ""
- sh.Range("F18").Value = ""
- sh.Range("Q4").Value = ""
- sh.Range("Q6").Value = ""
- sh.Range("Q8").Value = ""
- sh.Range("Q10").Value = ""
- sh.Range("Q12").Value = ""
- sh.Range("Q14").Value = ""
- sh.Range("Q16").Value = ""
- sh.Range("Q18").Value = ""
- Sheet2.Protect "12345"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement