Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to be available for some workbooks


When I'm recording macro in excel the macro is available to other
workbook, but when I'm typing the code in v.b. the macro is available
only to the specific workbook it wroten in. I have no idea why dose
it's happend


--
ditzafar
------------------------------------------------------------------------
ditzafar's Profile: http://www.excelforum.com/member.php...o&userid=29475
View this thread: http://www.excelforum.com/showthread...hreadid=491889

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default macro to be available for some workbooks

If I did Insert =Module, then in that module I place code like

Sub Dothings()
msgbox "In Dothings"
End Sub

then as long as the workbook containing that macro is open, it would
available like your recorded macros.

If you are declaring your sub as private or putting in arguments or using
sheet modules or the thisworkbook module, then your code would probably not
be available.

--
Regards,
Tom Ogilvy

"ditzafar" wrote in
message ...

When I'm recording macro in excel the macro is available to other
workbook, but when I'm typing the code in v.b. the macro is available
only to the specific workbook it wroten in. I have no idea why dose
it's happend


--
ditzafar
------------------------------------------------------------------------
ditzafar's Profile:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to be available for some workbooks


Is this code including things that's make him to be not avialable?
Sub macro1()
'
' Macro1 Macro
' Macro recorded 06/12/2005 by test2

i = 2
Do Until IsEmpty(Sheet1.Cells(i + 1, 3))
Sheet1.Cells(i, 6) = Sheet1.Cells(i + 1, 3) - Sheet1.Cells(i, 3)
i = i + 1
Loop

i = 2
Do Until IsEmpty(Sheet1.Cells(i + 1, 3))
Sheet1.Cells(i, 7) = Abs(Sheet1.Cells(i, 6))
i = i + 1
Loop



Sum = 0
For j = 2 To i
Sum = Sum + Sheet1.Cells(j, 7)
Next
Sheet1.Cells(j + 2, 7) = Sum




End Sub


--
ditzafar
------------------------------------------------------------------------
ditzafar's Profile: http://www.excelforum.com/member.php...o&userid=29475
View this thread: http://www.excelforum.com/showthread...hreadid=491889

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default macro to be available for some workbooks

No. If placed in any open workbook in a general module, it will be visible
in Tools=Macro=Macros.

As others have stated, the personal.xls workbook is provided as a convenient
location for locating macros which you want available each time you open
excel as excel automatically opens the personal.xls workbook when it is
opened. Otherwise, you would need to open whichever workbook contains that
macro - then it would be available as well.

--
Regards,
Tom Ogilvy

"ditzafar" wrote in
message ...

Is this code including things that's make him to be not avialable?
Sub macro1()
'
' Macro1 Macro
' Macro recorded 06/12/2005 by test2

i = 2
Do Until IsEmpty(Sheet1.Cells(i + 1, 3))
Sheet1.Cells(i, 6) = Sheet1.Cells(i + 1, 3) - Sheet1.Cells(i, 3)
i = i + 1
Loop

i = 2
Do Until IsEmpty(Sheet1.Cells(i + 1, 3))
Sheet1.Cells(i, 7) = Abs(Sheet1.Cells(i, 6))
i = i + 1
Loop



Sum = 0
For j = 2 To i
Sum = Sum + Sheet1.Cells(j, 7)
Next
Sheet1.Cells(j + 2, 7) = Sum




End Sub


--
ditzafar
------------------------------------------------------------------------
ditzafar's Profile:

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



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
macro to all workbooks [email protected] New Users to Excel 2 February 27th 08 06:16 PM
macro to all workbooks [email protected] New Users to Excel 0 February 27th 08 12:01 PM
macro to all workbooks [email protected] New Users to Excel 1 February 24th 08 11:47 AM
Macro for workbooks rogue6 Excel Programming 1 March 22nd 05 10:08 PM
Macro in all workbooks Pam Coleman Excel Discussion (Misc queries) 2 February 24th 05 07:49 PM


All times are GMT +1. The time now is 07:11 PM.

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"