LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default lookup physical first worksheet

Hi,

I don't know what is happening on your workbook actually but try this:

Sub Test()
Dim Numsheets As Integer
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
Numsheets = Worksheets.Count
Sheets(Numsheets - 1).Copy Befo=Sheets(Numsheets - 1)
Application.EnableEvents = True
End Sub

'Run this after the above test.
Sub RestoreSettings()
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
End Sub

if something changes, then there is a possibility that calculation of
your formula or some event procedures affect the macro.
I guess there might be a circular reference after copying the sheet.

--
HTH,

okaizawa


RichP wrote:
The code in the function worked well until now. I have taken out the
original first sheet and I believe that it looks for this sheet, I
don't really know.

When executing the following line an error occurs and the program seems
to be looping continuously through the function.

The code is Sheets(Numsheets-1).copy Befo=Sheets(Numsheets-1)
'Where Numsheets = worksheets.count

Which is supposed to copy the last but one sheet and paste the new
sheet just before the last one, As I said this all worked fine until I
moved the original sheet.

I hope this makes sence and someone can help


 
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
I need a template to track physical inventory williamc.tracy Excel Discussion (Misc queries) 1 November 17th 09 01:48 PM
Physical Constants for Excel Cragy Heap Excel Worksheet Functions 4 November 7th 06 02:00 PM
physical inventory sampling TWMAC Excel Discussion (Misc queries) 0 September 28th 06 01:03 PM
Phone Format PHYSICAL RTP Excel Discussion (Misc queries) 1 February 9th 05 10:15 PM
Text box physical string length Evan Excel Programming 2 August 7th 04 12:57 AM


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