Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can you run a macro while your computer is locked? | Excel Discussion (Misc queries) | |||
Formulaed cell response varies from computer to computer | Excel Discussion (Misc queries) | |||
Autocomplete works with my home computer but not the office computer | Excel Discussion (Misc queries) | |||
Macro crashing on different computer | Excel Programming | |||
Macro doesn't run on another computer | Excel Programming |