LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Sub From Yesterday

i got some help yesterday from some of you good people on
building a macro that would allow me to use a function
i've built to pull last names from full names. i'd like
the macro to insert a new column and use my function to
fill that new column with the last names of all the full
names in the first column.

i'm getting an error when i try to run this macro.

here it is:

Sub Macro1()

Dim iRow As Long
Dim rng As Range
Columns("B:B").Insert Shift:=xlToRight
Range("B1").FormulaR1C1 = "=PERSONAL.xls!getlastname(RC
[-1])"
With ActiveSheet
iRow = .Range("A" & Rows.Count).End(x1Up).Row
Set rng = .Range("B2:B" & iRow)
rng.FormulaR1C1 = "PERSONAL.xls!getlastname(RC[-1])"
End With

End Sub

after i run it, there is a new column inserted, and the
top record has the last name pulled out of the full name
and inserted into the new column.......and then the
error. the remainder of the column is empty.

the error states:

run time error '1004':

Application-defined or object-defined error

any ideas? thanks.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
yesterday countif grizzly6969 Excel Discussion (Misc queries) 5 March 27th 09 10:00 PM
Yesterday Loadmaster Excel Worksheet Functions 5 August 8th 08 09:41 PM
Returning Yesterday bollard Excel Worksheet Functions 5 May 12th 08 04:30 PM
I really need help. Need a formula. Need it yesterday. Dennis New Users to Excel 1 March 12th 07 08:53 PM
continuation from yesterday Mindy Excel Discussion (Misc queries) 4 June 22nd 06 11:13 PM


All times are GMT +1. The time now is 04:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"