ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   What is a vba? (https://www.excelbanter.com/excel-worksheet-functions/11291-what-vba.html)

Amber

What is a vba?
 
What is a vba code and how do I use it to sort sheets in a workbook? I have
the code, I just don't know how to program it and use it. Any advice would
be very helpful thank you.

Bob Phillips

For what you want, see http://www.cpearson.com/excel/sortws.htm

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Amber" wrote in message
...
What is a vba code and how do I use it to sort sheets in a workbook? I

have
the code, I just don't know how to program it and use it. Any advice

would
be very helpful thank you.




José BConde

Other way to learn about the VBA code: http://www.fontstuff.com/vba/index.htm

Regards,
José BConde

"Amber" escreveu:

What is a vba code and how do I use it to sort sheets in a workbook? I have
the code, I just don't know how to program it and use it. Any advice would
be very helpful thank you.


Ken Wright

Hit ALT+F11 and this will open the VBE (Visual Basic Editor)
Top left you will hopefully see an explorer style pane. Within this pane
you need to search for your workbook's name, and when you find it you may
need to click on the + to
expand it. Within that you should see the following:-

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
ThisWorkbook

If you have named your sheets then those names will appear in the brackets
above as opposed to
what you see at the moment in my note.

Right click on the where it says VBAProject(Your_Filename) and choose
'Insert Module' and it will now look like this

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
ThisWorkbook
Modules
Module1

Double click the Module1 bit and then paste in the code you have starting at
the Sub xxx() bit and finishing at the End Sub bit.

Then hit File / Close and return to Microsoft Excel and save the file. Now
just do Tools / Macro / Macros / xxx


If you then want to get rid of the macro, then do the following:-

Hit ALT+F11 and this will open the VBE (Visual Basic Editor)
Top left you will hopefully see an explorer style pane. Within this pane
you need to search for
your workbook's name, and when you find it you may need to click on the + to
expand it. Within
that you should see the following:-

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
etc..........................
ThisWorkbook
Modules
Module1

Right click on the Module1 and select remove. When prompted with a question
re exporting, just hit no. Then hit File / Close and return to Microsoft
Excel and save the
file.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"Amber" wrote in message
...
What is a vba code and how do I use it to sort sheets in a workbook? I

have
the code, I just don't know how to program it and use it. Any advice

would
be very helpful thank you.





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

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