Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run Macro in other computer


I had finished a macro, it works well in my computer. However,
when i try it in other computer, it does not work.

and the code cannot work is the following :

Range("I1").Select
ActiveCell.FormulaR1C1 = "Month"
ActiveCell.Offset(0, 1) = "=mid(sheet1!g2,4,2)"
ActiveCell.Offset(0, 1).Copy
ActiveCell.Offset(0, 1).PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks :=False, Transpose:=False

why did this situation occur? and How to sovle it?


--
hurriance
------------------------------------------------------------------------
hurriance's Profile: http://www.excelforum.com/member.php...o&userid=30882
View this thread: http://www.excelforum.com/showthread...hreadid=552885

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Run Macro in other computer

There are hundreds of ways things "does not work" in a computer, please be
more specific. Maybe you are getting an error message, the content of it
should in theory tell what's wrong.

HTH. Best wishes Harald


"hurriance" skrev i
melding ...

I had finished a macro, it works well in my computer. However,
when i try it in other computer, it does not work.

and the code cannot work is the following :

Range("I1").Select
ActiveCell.FormulaR1C1 = "Month"
ActiveCell.Offset(0, 1) = "=mid(sheet1!g2,4,2)"
ActiveCell.Offset(0, 1).Copy
ActiveCell.Offset(0, 1).PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks :=False, Transpose:=False

why did this situation occur? and How to sovle it?


--
hurriance
------------------------------------------------------------------------
hurriance's Profile:

http://www.excelforum.com/member.php...o&userid=30882
View this thread: http://www.excelforum.com/showthread...hreadid=552885



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Run Macro in other computer

"hurriance" wrote
in message ...

I had finished a macro, it works well in my computer. However,
when i try it in other computer, it does not work.

and the code cannot work is the following :

Range("I1").Select
ActiveCell.FormulaR1C1 = "Month"
ActiveCell.Offset(0, 1) = "=mid(sheet1!g2,4,2)"
ActiveCell.Offset(0, 1).Copy
ActiveCell.Offset(0, 1).PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks :=False, Transpose:=False

why did this situation occur? and How to sovle it?


This code worked fine for me in Excel 2003 with WinXP Home SP2. Are you
running it in the same workbook on both computers? What error are you
getting? If it's running in a different workbook on the non-working PC, is
there actually a sheet called "sheet1" in that workbook?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run Macro in other computer


I find that run well in excel XP, but not Excel 2000.
Actually, the G2 in Sheet1 store the date e.g. 01-05-2006
the code "=mid(sheet1!g2,4,2)" want to get the value of month.
But in excel 2000, it does work properly, it give the value 50 instead
of 05.
What change should I make in order to make it work in Excel 2000.


--
hurriance
------------------------------------------------------------------------
hurriance's Profile: http://www.excelforum.com/member.php...o&userid=30882
View this thread: http://www.excelforum.com/showthread...hreadid=552885

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Run Macro in other computer

"hurriance" wrote
in message ...

I find that run well in excel XP, but not Excel 2000.
Actually, the G2 in Sheet1 store the date e.g. 01-05-2006
the code "=mid(sheet1!g2,4,2)" want to get the value of month.
But in excel 2000, it does work properly, it give the value 50 instead
of 05.
What change should I make in order to make it work in Excel 2000.


That won't give you the month - at least not if cell g2 is formatted as
Date. Dates are stored as numbers in Excel, and that function will return
the 4th and 5th digits of the number that represents the date - not the
month. Use Month() instead - this is a Worksheet function as well as a VBA
function. Then format the output as "0#" if you want a leading 0 for months
1 to 9.




Reply
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
Can you run a macro while your computer is locked? dorn Excel Discussion (Misc queries) 1 November 8th 08 02:20 AM
Formulaed cell response varies from computer to computer WKH Excel Discussion (Misc queries) 3 November 21st 07 06:37 PM
Autocomplete works with my home computer but not the office computer Andy Excel Discussion (Misc queries) 4 December 11th 04 07:21 PM
Macro crashing on different computer Grace[_3_] Excel Programming 8 July 8th 04 04:12 AM
Macro doesn't run on another computer Terence Excel Programming 1 February 23rd 04 03:06 AM


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