LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default savings files with the use of variables

I need a little help with a macro I've created. I currently have a form with
check boxes indicating months and fiscal years. For example a user can click
the "july" (Checkbox1) and "FY05"(OptionsButton1) and then click a button
that automatically saves the file "September 2005 GL UPLOAD.csv" to a
location that I already specified in code. I used a multiple condition "If
then" statement to accomplish my task. The following code is a example of
this:


If CheckBox1.Value = True Then
If OptionButton1.Value = True Then

Sheets("54040 MONTHLY UPLOAD DATA").Select
Sheets("54040 MONTHLY UPLOAD DATA").Copy
ChDir _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\FY 2005 uploaded
files"
ActiveWorkbook.SaveAs Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\FY 2005 uploaded
files\September 2005 GL UPLOAD.csv" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

End If

End If

I basically copied this code numerous times, just changing the object names
and file names to make the macro work properly.The macro works fine, however,
it's not the most effecient macro. I had to write the code (above) 24 times
to accomadate just two fiscal years. My boss wants me to find a more
effecient way of accomplishing this task. He suggested looking into
declaring variables for the file names so when a user clicks a checkbox the
program will automatically know the naming of the file (and where) to save
the file. Can anyone help me with this, or at least point me in the right
direction? I have moderate excel programming skills and limited knowledge on
using variables.

Any information would be appreciated

--
Regards,

timmulla
 
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
Man Hour Savings Zul Excel Discussion (Misc queries) 1 August 26th 08 08:40 AM
Trying to get annual savings dspencer Excel Discussion (Misc queries) 3 May 30th 07 09:59 AM
Happy Daylight Savings Bernard Liengme Excel Discussion (Misc queries) 5 March 9th 07 04:38 PM
What kind of savings instrument is this? nomail1983 Excel Discussion (Misc queries) 3 November 8th 05 07:22 PM
Public variables and separate library files Richard[_32_] Excel Programming 2 September 28th 04 12:05 PM


All times are GMT +1. The time now is 06:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"