AVB Help please

L

LostwSQL

I have a form in Excel the tab named "Request Form" and another table
with the same field that I need to fill the form with in a different
workbook.
The table field showing below.
Subject Type of Request Severity Name E-Mail Channel 1 Channel 2 App1
App2 Date Initiative Describe
A2 B2 C2 D2 E2 F2 G2 H2 I2 J2 K2 L2


The request form has a bottom it would send an email when I finish
filling the form and it would generate random number to save it as
request number and file. I have over 3500 request to send that's why
I'm trying to find an automation way of doing it. Can you help create
the code to send the 3500 request in automation order?
Form field:
Subject = N7
Type of request = N10
Severity= N12
Name = J14
Email= R14
Channel1=N16
Channel2=R16
App1=J18
App2=N18
Date=J20
Initiative= R20
Describe=L22
Here is the code to submit the form
Private Sub Send_Form()


Dim strFrom As String
Dim TotalNum


AddIns("Analysis ToolPak").Installed = True


'Dark Blue = 11'
'White = 2'


If Range("R14") = "" Then
Range("R14").Select
Selection.Interior.ColorIndex = 6
MsgBox ("You must enter your E-Mail Address before Sending! Please
enter and Submit Again")
Exit Sub
End If
Range("R14").Select
Selection.Interior.ColorIndex = 2


Sheets("Values").Visible = True
Sheets("Values").Select


Range("H5").Select
ActiveCell.FormulaR1C1 = "=RANDBETWEEN(0,9)"
Range("H5").Select
Selection.NumberFormat = "0"


Range("I5").Select
ActiveCell.FormulaR1C1 = "=RANDBETWEEN(0,9)"
Range("I5").Select
Selection.NumberFormat = "0"


Range("J5").Select
ActiveCell.FormulaR1C1 = "=RANDBETWEEN(0,9)"
Range("J5").Select
Selection.NumberFormat = "0"


Range("L5").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Range("L5").Select
Selection.NumberFormat = "0"


Range("M5").Select
ActiveCell.FormulaR1C1 = "=RANDBETWEEN(0,9)"
Range("M5").Select
Selection.NumberFormat = "0"


Range("N5").Select
ActiveCell.FormulaR1C1 = "=RANDBETWEEN(0,9)"
Range("N5").Select
Selection.NumberFormat = "0"


Range("O5").Select
ActiveCell.FormulaR1C1 = "=RANDBETWEEN(0,9)"
Range("O5").Select
Selection.NumberFormat = "0"


Range("H5").Select
Application.CutCopyMode = False
Selection.Copy
Range("H6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


Range("I5").Select
Selection.Copy
Range("I6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


Range("J5").Select
Application.CutCopyMode = False
Selection.Copy
Range("J6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


Range("L5").Select
Application.CutCopyMode = False
Selection.Copy
Range("L6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "0"


Range("M5").Select
Selection.Copy
Range("M6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


Range("N5").Select
Application.CutCopyMode = False
Selection.Copy
Range("N6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


Range("O5").Select
Application.CutCopyMode = False
Selection.Copy
Range("O6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


ActiveWindow.SelectedSheets.Visible = False


Sheets("Request Form").Select
TotalNum = Range("N98").Text


Application.DisplayAlerts = False
On Error Resume Next
ActiveWorkbook.SaveAs _
Filename:="C:\" & "PSS Research Request # " & TotalNum & ".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False


Application.DisplayAlerts = False
ActiveWorkbook.SendMail _
Recipients:="(e-mail address removed)", _
Subject:="PSS Research Request # " & TotalNum


Application.DisplayAlerts = False
ActiveWorkbook.Close


End Sub
 
A

AVB Over My Head

I might got everybody confused on what I'm looking for. Let me try
again here.

The code I have is basically a macro that generates a form and sends
it by email as you might have figured that out already by reading it.
I have a table that has 3500 rows with fields as showing below
Subject (A2-A3499)
Type of Request (B2-B3499)
Severity (C2-C3499)
Name (D2-D3499)
E-Mail (E2-E3499)
Channel 1 (F2-F3499)
Channel 2 (G2-G3499)
App1 (H2-H3499)
App2 (I2-I3499)
Date (J2-J3499)
Initiative (K2-K3499)
Describe (L2-L3499)
The request form has a bottom that runs the macro in my post. What I'm
trying to create is a loop to run against the table and generate the
request to send them. I hope that helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top