Re: Macro-error 400- macro doesn't work on other computer
From: lunker55 (this_is_not_my_email_address_at_hotmail.com)
Date: 04/30/04
- Next message: lunker55: "Re: Autofilter doesn't work past blank rows"
- Previous message: Bush Kangaroo: "Earliest Date via LookUp?"
- Next in thread: Dave Peterson: "Re: Macro-error 400- macro doesn't work on other computer"
- Reply: Dave Peterson: "Re: Macro-error 400- macro doesn't work on other computer"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 30 Apr 2004 07:07:45 -0400
That doesn't seem to be my problem. This is the code. Macro3 is a recorded
macro.
Joe
Sub insert_rows()
Dim lastrow As Long
Dim row_index As Long
lastrow = Active***.Cells(Rows.Count, "B").End(xlUp).Row
For row_index = lastrow - 1 To 3 Step -1
If Cells(row_index, "B").Value <> Cells(row_index + 1, "B"). _
Value Then
Cells(row_index + 1, "B").Resize(2, 1).EntireRow. _
Insert (xlShiftDown)
Cells(row_index + 1, "B").Resize(2, 1).EntireRow. _
Interior.ColorIndex = 15
End If
Next
End Sub
Public Sub Delete_Blank_Rows()
Dim R As Long
Dim C As Range
Dim Rng As Range
On Error GoTo EndMacro
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
If Selection.Rows.Count > 1 Then
Set Rng = Selection
Else
Set Rng = Active***.UsedRange.Rows
End If
For R = Rng.Rows.Count To 1 Step -1
If Application.WorksheetFunction.CountA(Rng.Rows(R).EntireRow) = 0 Then
Rng.Rows(R).EntireRow.Delete
End If
Next R
EndMacro:
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 16/04/2004 by joe c
'
'
Rows("3:2715").Select
Selection.Sort Key1:=Range("B3"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
ActiveWindow.ScrollRow = 3
Range("B5").Select
End Sub
Sub start_all()
Macro3
Delete_Blank_Rows
insert_rows
End Sub
"Dave Peterson" <ec35720@msn.com> wrote in message
news:40919C84.6A850171@msn.com...
> I seached the VBA help for "trappable errors" and found this for 400:
>
> Form already displayed; can't show modally (Error 400)
>
> You can't use the Show method to display a visible form as modal. This
error has
> the following cause and solution:
>
> You tried to use Show, with the style argument set to 1 - vbModal, on an
already
> visible form.
> Use either the Unload statement or the Hide method on the form before
trying to
> show it as a modal form.
>
>
> ===
> Does this jog your memory? If not, you may want to post your code (not
the
> workbook)--and if possible, the offending line.
>
>
> lunker55 wrote:
> >
> > I sent an excel workbook to another computer.
> > On that computer, I created a macro button and assigned the macro to it
> > (which is in "This Workbook"), but I get "400" error show up and the
macro
> > doesn/t work.
> > Do I have the macro in the wrong place?
> >
> > Joe
>
> --
>
> Dave Peterson
> ec35720@msn.com
- Next message: lunker55: "Re: Autofilter doesn't work past blank rows"
- Previous message: Bush Kangaroo: "Earliest Date via LookUp?"
- Next in thread: Dave Peterson: "Re: Macro-error 400- macro doesn't work on other computer"
- Reply: Dave Peterson: "Re: Macro-error 400- macro doesn't work on other computer"
- Messages sorted by: [ date ] [ thread ]