J7House1984
New Member
- Joined
- Oct 30, 2020
- Messages
- 21
- Office Version
- 365
- Platform
- Windows
Hello,
I am at a very beginner level of knowledge, everything I've done in VBA has been self-taught.
I have 3 separate scripts that I need to combine into one script that can used as single button on the control panel tab.
Script 1
Script 2 part 1 = I have a field that the end user will manually enter in on a Command Tab. Then the below script will copy and paste the the entered fields into their respective columns on another page.
Script 2 Part 2=This script is intended to fill down the each of the newly created fields to the end of the data from "First Name" Data from the "UploadTemplate" Tab.
**Please note that this script works individually but it fills down 4 rows past the last entered row of text in the "First Name" Column (Please see screenshot for reference)
If someone can please help that would be greatly appreciated.
I am at a very beginner level of knowledge, everything I've done in VBA has been self-taught.
I have 3 separate scripts that I need to combine into one script that can used as single button on the control panel tab.
Script 1
VBA Code:
Sub CopyDataFromInQuicker()
Dim UsdRws As Long
With Worksheets("InquickerData")
UsdRws = .Range("M:AB").Find("*", , xlValues, , xlByRows, xlPrevious, , , False).Row
'Copy "MRN" Data
Worksheets("UploadTemplate").Range("B8").Resize(UsdRws - 1).Value = .Range("BR2:BR" & UsdRws).Value
'Copy "First Name" Data
Worksheets("UploadTemplate").Range("D8").Resize(UsdRws - 1).Value = .Range("S2:S" & UsdRws).Value
'Copy "Last Name" Data
Worksheets("UploadTemplate").Range("E8").Resize(UsdRws - 1).Value = .Range("U2:U" & UsdRws).Value
'Copy "Middle Initial" Data
Worksheets("UploadTemplate").Range("F8").Resize(UsdRws - 1).Value = .Range("T2:T" & UsdRws).Value
'Copy "Birthdate" Data
Worksheets("UploadTemplate").Range("G8").Resize(UsdRws - 1).Value = .Range("AA2:AA" & UsdRws).Value
'Copy "Email" Data
Worksheets("UploadTemplate").Range("H8").Resize(UsdRws - 1).Value = .Range("Y2:Y" & UsdRws).Value
'Copy "City" Data
Worksheets("UploadTemplate").Range("J8").Resize(UsdRws - 1).Value = .Range("V2:V" & UsdRws).Value
'Copy "State" Data
Worksheets("UploadTemplate").Range("K8").Resize(UsdRws - 1).Value = .Range("V2:V" & UsdRws).Value
'Copy "Zip" Data
Worksheets("UploadTemplate").Range("L8").Resize(UsdRws - 1).Value = .Range("X2:X" & UsdRws).Value
'Copy "Gender" Data
Worksheets("UploadTemplate").Range("P8").Resize(UsdRws - 1).Value = .Range("AB2:AB" & UsdRws).Value
'Copy "Registration Date" Data
Worksheets("UploadTemplate").Range("U8").Resize(UsdRws - 1).Value = .Range("M2:M" & UsdRws).Value
End With
End Sub
Script 2 part 1 = I have a field that the end user will manually enter in on a Command Tab. Then the below script will copy and paste the the entered fields into their respective columns on another page.
VBA Code:
Sub Copy_Paste()
'Copy "Lead Source" Data
Worksheets("Control Panel").Range("X8").Copy
'PasteSpecial Values Only
Worksheets("UploadTemplate").Range("Q8").PasteSpecial Paste:=xlPasteValues
'Copy "MAC ID" Data
Worksheets("Control Panel").Range("X10").Copy
'PasteSpecial Values Only
Worksheets("UploadTemplate").Range("S8").PasteSpecial Paste:=xlPasteValues
'Copy "Status" Data
Worksheets("Control Panel").Range("X12").Copy
'PasteSpecial Values Only
Worksheets("UploadTemplate").Range("T8").PasteSpecial Paste:=xlPasteValues
'Autofill To end of data
'Clear Clipboard (removes data around your original data set)
Application.CutCopyMode = False
End Sub
Script 2 Part 2=This script is intended to fill down the each of the newly created fields to the end of the data from "First Name" Data from the "UploadTemplate" Tab.
**Please note that this script works individually but it fills down 4 rows past the last entered row of text in the "First Name" Column (Please see screenshot for reference)
VBA Code:
'Autofill To end of data
Sub Copy_Paste1()
Dim LR As Long
LR = ActiveSheet.UsedRange.Rows.Count
Range("Q8").AutoFill Destination:=Range("Q8:Q" & LR)
Range("S8").AutoFill Destination:=Range("S8:S" & LR)
Range("T8").AutoFill Destination:=Range("T8:T" & LR)
End Sub
If someone can please help that would be greatly appreciated.