Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Making a Form for User-friendly Macros?

I am creating an Excel file with several sheets on it. To make this as brief
as possible, I am (sadly) the most technologically savvy person in my
department. I need to find a way to create a macro that others can easily
change, so that when they change the file name, the macro code doesn't have
to be changed- it just has to be run.

For example:

I make "Assessment Template", and create a macro that works with it. That
macro has to open another Excel file, so that path is written in the macro
code. Just in this example, when I open this on another computer, I will have
to change the code- something other professors won't do.

What I was wondering is, is there a way to create a form in Excel that the
professor fills out before they run the macro. It would have the following:

the name of the data file
the name of the sheet the data is being transferred to
the number of rows information will be taken from from
the number of columns the information will be special pasted into

And so on...

Is it possible? If so, where would I find out how to do this?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Making a Form for User-friendly Macros?

This is all possible. You could do this one of several ways -

One way would be to have some cells on a worksheet in the workbook where the
user could simply type in the information needed and then click a button that
would run a macro that would read that information from the worksheet and use
it in your macro to find the data in the other workbook and manipulate it as
you need.

Just a couple of snippets of how the could would work here. Assuming they
enter the full path to the other file on a sheet named [SysInfoSheet] into
cell A1, then the code might look something like
....
Dim dataWBName As String
dataWBName = ThisWorkbook.Worksheets("SysInfoSheet").Range("A1" )
Workbooks.Open dataWBName
....

Another way to just get a file name is to let the user browse for it in the
File Open Dialog, and in code it looks something like this:

Dim dataWBName As Variant
dataWBName = Application.GetOpenFilename
If dataWBName = False Then
'probably get out, they used [Cancel] or [x] to close the
'dialog without choosing a file
End If
Workbooks.Open dataWBName
.....

If you feel I can help you more with this, feel free to contact me at
(remove spaces)
Help From @ JLatham Site.com


"SeventFloorProfessor" wrote:

I am creating an Excel file with several sheets on it. To make this as brief
as possible, I am (sadly) the most technologically savvy person in my
department. I need to find a way to create a macro that others can easily
change, so that when they change the file name, the macro code doesn't have
to be changed- it just has to be run.

For example:

I make "Assessment Template", and create a macro that works with it. That
macro has to open another Excel file, so that path is written in the macro
code. Just in this example, when I open this on another computer, I will have
to change the code- something other professors won't do.

What I was wondering is, is there a way to create a form in Excel that the
professor fills out before they run the macro. It would have the following:

the name of the data file
the name of the sheet the data is being transferred to
the number of rows information will be taken from from
the number of columns the information will be special pasted into

And so on...

Is it possible? If so, where would I find out how to do this?

Thanks!

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
User-friendly lookup solutions needed Sally Excel Discussion (Misc queries) 3 September 26th 07 06:26 AM
I need a user friendly route sheet! Help! :} nrosales84 New Users to Excel 0 September 17th 07 10:10 PM
How do I create an user form to run macros in excel? mgj72394 Excel Discussion (Misc queries) 5 April 28th 07 06:40 PM
Looking for a production schedule excel/access & user friendly? John Setting up and Configuration of Excel 0 February 9th 07 02:17 PM
how to do a web query on an web browser on an user form using macros Sunny via OfficeKB.com Links and Linking in Excel 0 March 28th 06 01:47 PM


All times are GMT +1. The time now is 11:48 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"