You are here:

Excel/Submit, group, add


Hey, this is my form, feel free to email me directly. password is "k"
I want my users to enter stuff in to enter data in sheet 1 (THE FORM), then click the submit button that coppies the data and past it in the next available new line for sheet 2 (THE TABLE). The form must be cleared of the data entered. The date each line was submitted should go in column "J" of Table.

Thank you for the file - I had problems accessing it on some computers due to security restrictions, so my apologies for the delay in replying.  I see now that by submit you were meaning a data entry system - I had viewed it as being two seperate workbooks, so data was being emailed across - so again apologies for that.  The suggested macro is

Sub AidanTestSubmit()
'process needs to be
'for every record on this submission sheet
'create a new blank row on sheet 2
'Add it
'fields on sheet2 are
'JOB DATE          column A
'REGION          Column B
'PARISH          column C
'No. (IN)          Column E
'Rate (IN)          Column F
'No. (OUT)          Column G
'Rate (OUT)          Column H
'Month          Column I
'DATE SUBMITTED          Column J
Application.StatusBar = "Please wait - submitting"
Application.ScreenUpdating = False
Dim OutVar As Long, WriteVar As Long
WriteVar = WorksheetFunction.CountA(Sheets("Sheet2").Range("a:A")) + 1
OutVar = 6
While Cells(OutVar, 1).Value <> ""
   With Sheets("Sheet2")
       .Cells(WriteVar, 1).Value = Cells(OutVar, 1).Value
       .Cells(WriteVar, 2).FormulaR1C1 = "=IF(RC[1]="""","""",_xlfn.IFERROR(VLOOKUP(RC[1],Info!R3C1:R17C2,2,FALSE),""Error""))"
       .Cells(WriteVar, 3).Value = Cells(OutVar, 2).Value
       .Cells(WriteVar, 4).Value = Cells(OutVar, 3).Value
       .Cells(WriteVar, 5).Value = Cells(OutVar, 4).Value
       .Cells(WriteVar, 6).Value = Cells(OutVar, 5).Value
       .Cells(WriteVar, 7).Value = Cells(OutVar, 6).Value
       .Cells(WriteVar, 8).Value = Cells(OutVar, 7).Value
       .Cells(WriteVar, 9).FormulaR1C1 = "=IF(RC[-8]="""","""",TEXT(RC[-8],""mmmm-yyyy""))"
       .Cells(WriteVar, 10).Value = Now()
       Range("a" & OutVar & ":g" & OutVar).ClearContents
   End With
   OutVar = OutVar + 1
   WriteVar = WriteVar + 1
Application.ScreenUpdating = True
Application.StatusBar = ""
End Sub

I cannot see your email (it doesn't show to the expert on this system) but mine is if you need to discuss anything further on this directly with me, or of course you can reply via AllExperts.

I hope this gives you what you need.
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Aidan Heritage


I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for all versions from 2 onwards. I'm based in the UK, so please allow for time differences when asking me questions from other parts of the world! As AllExperts closes down, just google me to find my details - I will still be around answering questions!


My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.

I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!

©2017 All rights reserved.

[an error occurred while processing this directive]