Hi,
I have a workbook with a macro that extracts information from row 1 and pastes it as values as a new row below the Data table.
I want to add a step to extend the table over the new row, but none of the options I have found so far seem to do it.
My VBA knowledge is negligible (I'm usually SQL-based).
I have pasted the entire VBA below in case it's helpful.
I have a workbook with a macro that extracts information from row 1 and pastes it as values as a new row below the Data table.
I want to add a step to extend the table over the new row, but none of the options I have found so far seem to do it.
My VBA knowledge is negligible (I'm usually SQL-based).
I have pasted the entire VBA below in case it's helpful.
VBA Code:
Option Explicit
Sub Submit_Data()
Dim Data_Sheet, Front_Page As Worksheet
Dim Paste_Destination, UserName As Variant
Dim Question, Counter As Integer
'Set variables
Set Data_Sheet = ThisWorkbook.Sheets("Data")
Set Front_Page = ThisWorkbook.Sheets("Front Page")
Paste_Destination = "A" & Data_Sheet.Range("A65536").End(xlUp).Row + 1
UserName = Front_Page.Range("User_Name")
'Ensure required fields are input (User's Name)
If UserName = "" Then
MsgBox ("Please input your name at the top of the sheet")
End
End If
'Ensure required field are input (Representative and Call Options Sections)
If Front_Page.Range("B21") = "" Then
MsgBox ("Rep polite/courteous field requires an input")
End
End If
If Front_Page.Range("B22") = "" Then
MsgBox ("All questions answered field requires an input")
End
End If
If Front_Page.Range("B26") = "" Then
MsgBox ("Cash/Finance field requires an input")
End
End If
'Confirmation from user
Question = MsgBox("Are you sure? This will submit the call data and clear the front page", vbYesNo + vbQuestion + vbDefaultButton2)
If Question = vbNo Then End
Application.ScreenUpdating = False
'Copy and paste data from row 1 into the first available row under the headings
Data_Sheet.Range("A1:AC1").Copy
Data_Sheet.Range(Paste_Destination).PasteSpecial xlPasteValues
'Clear information from front page
Front_Page.Range("Clear_Range").ClearContents
Application.ScreenUpdating = True
End Sub