ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   why the macro is not included in the list? (https://www.excelbanter.com/excel-discussion-misc-queries/449969-why-macro-not-included-list.html)

sumesh56

why the macro is not included in the list?
 
1 Attachment(s)
i opened a worksheet named "get the top".clicked on vba.view code then pasted a code.it is module No.11.minimised it.went to the excel file. when i tried to run the macro..it doesn't work. when i clicked on the macro under the code group i don't see the macro which i included recently.pls see that module number11 contains the code.(workbook_open)see pic 3 named macrolist in personal. there are only 4 macros listed there.module no.11 is not there.see pic no.2.there are a lot many modules in which no.11 is also there. my question is though in the module list, no.11 is present,why it is not coming when we click on macro under the code group? when i see the personal workbook only four macros are showing. where are others?

GS[_2_]

why the macro is not included in the list?
 
You can only see macros that aren't scoped *Private*, and do not take
arguments! Show the macro you want to run from the Macros dialog...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



GS[_2_]

why the macro is not included in the list?
 
Try...

In ThisWorkbook code window:

Option Explicit

Private Sub Workbook_Open()
Call SelectTopRow
End Sub


In a standard module:

Option Explicit

Sub SelectTopRow()
Rows(1).Select
End Sub

The above macro will now list in the Macros dialog!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



sumesh56

Quote:

Originally Posted by GS[_2_] (Post 1616858)
Try...

In ThisWorkbook code window:

Option Explicit

Private Sub Workbook_Open()
Call SelectTopRow
End Sub


In a standard module:

Option Explicit

Sub SelectTopRow()
Rows(1).Select
End Sub

The above macro will now list in the Macros dialog!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

Hi Garry,
thanks a lot. as you said when i changed the first line of the code, it is there in the macros dialog.what i understood is, there should not be the word "private" in the code.am i right?

sumesh56

Quote:

Originally Posted by sumesh56 (Post 1616859)
Hi Garry,
thanks a lot. as you said when i changed the first line of the code, it is there in the macros dialog.what i understood is, there should not be the word "private" in the code.am i right?

I opened the worksheet. vba -click on the module and pasted yours. then i clicked on the macros in the code group. now i can see the code name in the list. But on vba doble clicked on the worksheet. clicked view code. pasted yours. went to macros. i cannot see the your macro there. it is not listed there. kindly detail it . thanks.

sumesh56

Quote:

Originally Posted by sumesh56 (Post 1616860)
I opened the worksheet. vba -click on the module and pasted yours. then i clicked on the macros in the code group. now i can see the code name in the list. But on vba doble clicked on the worksheet. clicked view code. pasted yours. went to macros. i cannot see the your macro there. it is not listed there. kindly detail it . thanks.


this macro is not serving the purpose. I open a worksheet with so many sheets. i select one and copy contents from it. goes to the second sheet paste it there. then comes to the first one. then i should get the sheet with the top row. that is what i want. means i should get a sheet or a file open with the top row displayed. no matter if it is opened afresh or is being selected from a batch of sheets.thanks


All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com