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: 155
Default Compile Error: Expected:(

I have a macro that works fine in my workbook, yet when I go into VBA and try
to run it there (using F5 or stepping into it with F8 I get the error. All of
the other macros in theis workbook work fine from VBA.

Any ideas?

Here is the macro:

Sub Line()
'
' Line Macro


'

ActiveSheet.Unprotect Password:=""

If Intersect(ActiveCell, Range("range1")) Is Nothing Then

Range("RANGE1.1").Select
Do
If IsEmpty(ActiveCell) = True Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = False
ActiveCell.Offset(-1, 1).Select
ActualRow = Selection.Row
Cells(ActualRow + 1, 1).EntireRow.Insert
Range(Cells(ActualRow, 1), Cells(ActualRow, 33)).Copy _
Destination:=Cells(ActualRow + 1, 1)

Else
ActualRow = Selection.Row
Cells(ActualRow + 1, 1).EntireRow.Insert
Range(Cells(ActualRow, 1), Cells(ActualRow, 33)).Copy _
Destination:=Cells(ActualRow + 1, 1)

End If

ActiveSheet.Protect Password:="", DrawingObjects:=True, Contents:=True,
Scenarios:=True
Range("RANGE1.1").Select

End Sub


 
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
Compile Error:Expected Array Fatima CN Excel Programming 2 October 15th 09 03:23 AM
Compile Error: Expected Array BEEJAY Excel Programming 7 December 8th 08 08:23 PM
compile error - expected an array John Excel Programming 8 September 21st 06 08:04 PM
compile error: Expected: = ...Why? cesw[_2_] Excel Programming 3 September 10th 05 12:41 AM
Compile Error: Expected End Property George J[_3_] Excel Programming 4 August 3rd 05 03:35 PM


All times are GMT +1. The time now is 06:41 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"