PC Review


Reply
Thread Tools Rate Thread

Automate Menu item with VBA?

 
 
=?Utf-8?B?VEtN?=
Guest
Posts: n/a
 
      19th Oct 2006
I have several reports that I export from Access to Excel which look
terrible. I was wondering if there is a simple way to auto format the columns
(align) by code via the menu item? Example the manual way. Select complete
workbook, format, columns, autoformat. can this be done via VBA?
 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      19th Oct 2006
If you can do it manually, you can record the VBA code.

Tools>Record New macro>..make your changes. stop recording.
The generated code will probably not be the most efficient, but will show
you the requirements.

NickHK

"TKM" <(E-Mail Removed)> 级糶秎ン穝籇:76CBCB51-C1E4-4E7A-B36E-(E-Mail Removed)...
>I have several reports that I export from Access to Excel which look
> terrible. I was wondering if there is a simple way to auto format the
> columns
> (align) by code via the menu item? Example the manual way. Select complete
> workbook, format, columns, autoformat. can this be done via VBA?



 
Reply With Quote
 
=?Utf-8?B?VEtN?=
Guest
Posts: n/a
 
      19th Oct 2006
Thank you it is a great start.. Do you know where I would put the code so
when I export an updated report from Access that this code runs and does what
I recorded?

Thanks again

"NickHK" wrote:

> If you can do it manually, you can record the VBA code.
>
> Tools>Record New macro>..make your changes. stop recording.
> The generated code will probably not be the most efficient, but will show
> you the requirements.
>
> NickHK
>
> "TKM" <(E-Mail Removed)> 录露录g漏贸露l楼贸路s禄D:76CBCB51-C1E4-4E7A-B36E-(E-Mail Removed)...
> >I have several reports that I export from Access to Excel which look
> > terrible. I was wondering if there is a simple way to auto format the
> > columns
> > (align) by code via the menu item? Example the manual way. Select complete
> > workbook, format, columns, autoformat. can this be done via VBA?

>
>
>

 
Reply With Quote
 
Glenn
Guest
Posts: n/a
 
      19th Oct 2006
If you use the Record Macro option described by NickHK, you will see an
option on the "Record Macro" dialog box titled "Store macro in:"
Select "Personal Macro Workbook" and this macro will always be
available to you when you use Excel.

If you create/edit your macro in VBA, you'll want add a module to the
"VBAProject (PERSONAL.XLS)" project. (By the way, if you record a
macro, it will automatically create a new module in this project for
you)

When you close Excel, if you've added/changed macros to your Personal
Macro Workbook, you will be prompted whether you want to save the
changes you made to the Personal Macro Workbook. Click the "Yes"
button, otherwise your macros will be lost.

Good Luck,
Glenn Ray



TKM wrote:
> Thank you it is a great start.. Do you know where I would put the code so
> when I export an updated report from Access that this code runs and does what
> I recorded?
>
> Thanks again
>
> "NickHK" wrote:
>
> > If you can do it manually, you can record the VBA code.
> >
> > Tools>Record New macro>..make your changes. stop recording.
> > The generated code will probably not be the most efficient, but will show
> > you the requirements.
> >
> > NickHK
> >
> > "TKM" <(E-Mail Removed)> 级糶秎ン穝籇:76CBCB51-C1E4-4E7A-B36E-(E-Mail Removed)...
> > >I have several reports that I export from Access to Excel which look
> > > terrible. I was wondering if there is a simple way to auto format the
> > > columns
> > > (align) by code via the menu item? Example the manual way. Select complete
> > > workbook, format, columns, autoformat. can this be done via VBA?

> >
> >
> >


 
Reply With Quote
 
=?Utf-8?B?VEtN?=
Guest
Posts: n/a
 
      19th Oct 2006
Thank you very much!

"Glenn" wrote:

> If you use the Record Macro option described by NickHK, you will see an
> option on the "Record Macro" dialog box titled "Store macro in:"
> Select "Personal Macro Workbook" and this macro will always be
> available to you when you use Excel.
>
> If you create/edit your macro in VBA, you'll want add a module to the
> "VBAProject (PERSONAL.XLS)" project. (By the way, if you record a
> macro, it will automatically create a new module in this project for
> you)
>
> When you close Excel, if you've added/changed macros to your Personal
> Macro Workbook, you will be prompted whether you want to save the
> changes you made to the Personal Macro Workbook. Click the "Yes"
> button, otherwise your macros will be lost.
>
> Good Luck,
> Glenn Ray
>
>
>
> TKM wrote:
> > Thank you it is a great start.. Do you know where I would put the code so
> > when I export an updated report from Access that this code runs and does what
> > I recorded?
> >
> > Thanks again
> >
> > "NickHK" wrote:
> >
> > > If you can do it manually, you can record the VBA code.
> > >
> > > Tools>Record New macro>..make your changes. stop recording.
> > > The generated code will probably not be the most efficient, but will show
> > > you the requirements.
> > >
> > > NickHK
> > >
> > > "TKM" <(E-Mail Removed)> 录露录g漏贸露l楼贸路s禄D:76CBCB51-C1E4-4E7A-B36E-(E-Mail Removed)...
> > > >I have several reports that I export from Access to Excel which look
> > > > terrible. I was wondering if there is a simple way to auto format the
> > > > columns
> > > > (align) by code via the menu item? Example the manual way. Select complete
> > > > workbook, format, columns, autoformat. can this be done via VBA?
> > >
> > >
> > >

>
>

 
Reply With Quote
 
=?Utf-8?B?VEtN?=
Guest
Posts: n/a
 
      20th Oct 2006
Any ideas on how to keep the alignment from the recorded macro when a user
runs an updated report. Seems the report get overwritten and I have to start
from scratch? Any ideas on this? I am using an Access report and using the
output and or transferspread sheet acion in Access. Thanks again

"Glenn" wrote:

> If you use the Record Macro option described by NickHK, you will see an
> option on the "Record Macro" dialog box titled "Store macro in:"
> Select "Personal Macro Workbook" and this macro will always be
> available to you when you use Excel.
>
> If you create/edit your macro in VBA, you'll want add a module to the
> "VBAProject (PERSONAL.XLS)" project. (By the way, if you record a
> macro, it will automatically create a new module in this project for
> you)
>
> When you close Excel, if you've added/changed macros to your Personal
> Macro Workbook, you will be prompted whether you want to save the
> changes you made to the Personal Macro Workbook. Click the "Yes"
> button, otherwise your macros will be lost.
>
> Good Luck,
> Glenn Ray
>
>
>
> TKM wrote:
> > Thank you it is a great start.. Do you know where I would put the code so
> > when I export an updated report from Access that this code runs and does what
> > I recorded?
> >
> > Thanks again
> >
> > "NickHK" wrote:
> >
> > > If you can do it manually, you can record the VBA code.
> > >
> > > Tools>Record New macro>..make your changes. stop recording.
> > > The generated code will probably not be the most efficient, but will show
> > > you the requirements.
> > >
> > > NickHK
> > >
> > > "TKM" <(E-Mail Removed)> 录露录g漏贸露l楼贸路s禄D:76CBCB51-C1E4-4E7A-B36E-(E-Mail Removed)...
> > > >I have several reports that I export from Access to Excel which look
> > > > terrible. I was wondering if there is a simple way to auto format the
> > > > columns
> > > > (align) by code via the menu item? Example the manual way. Select complete
> > > > workbook, format, columns, autoformat. can this be done via VBA?
> > >
> > >
> > >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automate Pivot Table to only 1 Item =?Utf-8?B?U3RldmU=?= Microsoft Excel Misc 0 25th Sep 2007 08:58 PM
Not able to call a function from custom menu item that is added in word menu(File) jayrm100@yahoo.com Microsoft Word Document Management 0 9th Nov 2005 05:36 AM
Automate a Menu item Donna Microsoft Access Form Coding 7 16th Aug 2005 05:25 AM
I create a menu item using VB, within a custom contacts form. I do not want the item to be visible in other forms or views. How do I do this?? Tore Microsoft Outlook Form Programming 0 10th Mar 2004 01:03 PM
Transparent blue color when mousing over menu or selecting menu item =?Utf-8?B?c2h1dHRlcmJ1ZzEzODU2?= Windows XP Help 0 19th Feb 2004 06:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:59 AM.