LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jeff
 
Posts: n/a
Default Macro hangs up often but sometimes works fine

Hi,

I have a macro that sometimes hangs up and sometimes not.

This is what I'm using:-

Application.ScreenUpdating = False
Sheets("Analysis").Select
Range("C2").Select
Selection.Copy
Sheets("Report").Select
myUnprotect 'Disable Report worksheet protection
Sheets("Report").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False 'IT HANGS UP HERE
Sheets("Analysis").Select
Range("E2").Select
Selection.Copy
Sheets("Report").Select
Range("B2").Select 'Strength
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
Sheets("Report").Select
Range("A2:M2").Select
Selection.Copy
If Range("A3") = 0 Then 'it is empty
Range("A3:M3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
End If
If Range("A3") < 0 Then
' Application.Goto Sh.Range("A1"), True 'won't
work if I include this line
Selection.End(xlDown).Activate 'IT HANGS UP HERE TOO
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= False, Transpose:=False
End If
Range("A2:M2").Select
Selection.ClearContents 'and I lose the formats set earlier!
Range("A2").Select
++++++
(repetitons of copy / paste)
+++++

Assistance greatfully accepted.

Jeff


 
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
Macro works but buttons don't markvi Excel Discussion (Misc queries) 0 June 8th 06 09:19 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Tab-naming macro only works once :-( Stilla Excel Worksheet Functions 3 February 10th 06 03:09 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Highlight Range - wrong macro, please edit. Danny Excel Worksheet Functions 8 October 19th 05 11:11 PM


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

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

About Us

"It's about Microsoft Excel"