Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 81
Default Macro Problem

Hi Everyone.

I do not know how to write a Macro, but I find it convenient to record one
when I need it. I encountered a problem on recording the following Macro:

Sub Copy2()
'
' Copy2 Macro
' Macro recorded 21/09/2008 by Albert Bartolo
'

'
ActiveWorkbook.Save
Sheets("Ships").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Ships", "Phoenicia", "Salvo Grima", "Hotels", "Hard Rock", _
"Corinthia Flight Cat", "Airest", "La Salita - Arches", "Lemongrass
Imported", _
"Lemongrass Local")).Select
Sheets("Lemongrass Local").Activate
Sheets(Array("Ships", "Phoenicia", "Salvo Grima", "Hotels", "Hard Rock", _
"Corinthia Flight Cat", "Airest", "La Salita - Arches", "Lemongrass
Imported", _
"Lemongrass Local")).Copy
ChDir "C:\Documents and Settings\Bartolo\Desktop\Quotations\Archive"
ActiveWindow.Close
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Ships").Select
End Sub

If I copy the folder I am using this macro in, onto a pendrive or to another
computer it does not work. I realised that the problem is the ChDir, which I
marked in bold. Is there a possibility to modify the Macro so as it can work
on any computer.

Thank You

Albert
 
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 tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Macro problem [email protected][_2_] Excel Discussion (Misc queries) 2 March 4th 08 11:48 PM
Macro problem Bonbon Excel Worksheet Functions 2 February 18th 06 08:07 PM
Macro Problem tweacle Excel Worksheet Functions 1 January 12th 06 05:46 PM


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