Macro to edit text string data input
Tom:
I set up Sheet 1 as my 'data input' and 'parse data' sheet. I set up Sheet 2
as the 'clean data' sheet and named it Data, with my mailing list headers in
A1 through H1.
I added the following macro to determine the next open row in the Data sheet
per your instructions:
Sub Append()
Set rng = Worksheets("Data").Cells(Rows.Count, "A").End(xlUp)(2)
rng.Value = sLast_Name
rng.Offset(0, 1).Value = sFirst_Name
rng.Offset(0, 2).Value = sOffice
rng.Offset(0, 3).Value = sCompany_Address
rng.Offset(0, 4).Value = sCity_and_Zip
rng.Offset(0, 5).Value = sphone
rng.Offset(0, 6).Value = sFax
rng.Offset(0, 7).Value = sEmail_Address
End Sub
and I get the following error message when I run Append:
"Set" is highlighted
Microsoft Visual Basic error
Compile Error:
Invalid Outside Procedure
What am I doing wrong?
Thanks...
Dee
"Tom Ogilvy" wrote:
to find the next open row in you data (assume the sheet with the cleaned up
data is named Data)
set rng = Worksheets("Data").Cells(rows.count,"A").End(xlup) (2)
rng.Value = sLastName
rng.offset(0,1).value = sFirstName
rng.offset(0,2).Value = sOffice
and so forth
--
Regards,
Tom Ogilvy
|