PDA

View Full Version : Error in expression



Klartigue
09-08-2011, 07:49 AM
I keep getting an error with the following expression in my macro:

Sub Name()
'
' Name Broker
'
Columns("F:F").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("F1").Select
ActiveCell.FormulaR1C1 = "Broker"
Range("F2").Select

End Sub

Do you know whats wrong?

Bob Phillips
09-08-2011, 08:02 AM
I'll tell you when you add VBA tags to your code.

Kenneth Hobs
09-08-2011, 08:03 AM
You used a reserved keyword, Name. Use another name for your Sub.

Klartigue
09-08-2011, 08:06 AM
what are VBA tags

Aflatoon
09-08-2011, 08:23 AM
See the FAQ here (http://www.vbaexpress.com/forum/faq.php?faq=vb_read_and_post#faq_vb_special_codes).