Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Record Worksheet Content as Macro and Execute from another Worksheet
Hi Warwick,
As far as I know noone would place the contents of sheet1 into a macro because you can simply create a copy of a worksheet. You may be thinking along the lines of copy and paste, but if it is for an entire sheet you might do the following: manually: Edit, Move or copy sheet..., place a checkmark next to Copy. in VBA: 'Create New Sheet Sheets.Add 'defaults before 'Rename current Sheet ActiveSheet.Name = "Renamed14a" Not clear on what you want though, in order to write a macro you usually need to know exactly how to do something manually. You get best results in the newsgroups if you have a specific question on what you need help with and I think your question is much too general and not clear on what you want accomplished. Are you trying to create as many sheets as you have rows in Sheet2. or perhaps modify as many rows as you have cells in column a of sheet2. I suggest you practice manually getting the results you want so that you can perhaps record a macro, and better explain what you need. The recorded macro will tell you what kind of instructions you need, it will not generate programming loops for you. If you can find code that almost does what you want then you are half way to a solution of your own. You can find lots of solutions to problems in web pages and in Google Groups archives if you can figure out what to search on. http://www.mvps.org/dmcritchie/excel/xlnews.htm and see my search page below. I think you are trying to in get too deep all at once. See my excel.htm page below for some tutorials, once you have learned from them, suggest the fastest way would be to purchase a book and by going over the free tutorials you should be able to bypass the real elementary books. BTW, since this appears to be your first posting in Excel groups, it is possible that you do not know how to install a macro, you can get instructions to install and invoke in http://www.mvps.org/dmcritchie/excel/getstarted.htm and I would practice with some macros that you can know exactly what it does and would be useful to you see http://www.mvps.org/dmcritchie/excel/proper.htm http://www.mvps.org/dmcritchie/excel/join.htm --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Warwick Renshaw" wrote in message . .. Could someone advise me how to... a)Record the contents of sheet1 as a macro b)Execute the recorded macro from multiple cells within sheet2 Sheet1 contains a financial model. The model reads an input parameter (cell A1), performs a calculation (cells B1:Y99), and outputs a result (cell X99). Sheet2 contains a list of parameters (cells A1:A999) and a list of results of the corresponding calculations performed by the macro (cells B1:B999). I would like Excel to execute the macro repetitively, progressively working down the input parameters recorded in cells A1 to A99 in Sheet2 and recording the results from the model in cells B1 to B99 in Sheet2. I am new to macros and don't understand how to record the contents of an existing sheet as a macro. I also do not understand how to specify, at multiple points within a sheet, that the macros has to be executed, and that it should accept the contents of a specific cell as input. In practice this macro would be executed several thousand times, reading a couumn of parameters and producing a column of results. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Record Worksheet Content as Macro and Execute from another Worksheet
David, Thank you for the response. I am simply trying to execute a block of code (some several hundred cells in a worksheet) multiple times, based on a changing parameter, and record the corresponding results. The parameters are listed in a column several thousand rows long (say A1 through A9999). I wish to record the rseults relationg to each parameter in the adjacent adjacent column (say B1 through B9999). I am then graphing the results. I have currently duplicated the block of code in the several hundred cells (a financial model) as many times as I have parameters. This has limited the number of parameters and created a workbook 110MB+ in size, which is unworkable. I assumed that this could be solved by using a macro, so progressively work down the list of parameters, perform the calculation, and record the results. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Record Worksheet Content as Macro and Execute from another Worksheet
If I understand you. You are trying to create 9999 worksheets but
instead of keeping them you are creating them one sheet at a time and picking out a result, delete the new sheet, and continue by creating the next worksheet. If you have only one parameter that changes, can't you just create a User Defined Function to return a value based on one or more parameters ? --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Warwick Renshaw" wrote in message ... David, Thank you for the response. I am simply trying to execute a block of code (some several hundred cells in a worksheet) multiple times, based on a changing parameter, and record the corresponding results. The parameters are listed in a column several thousand rows long (say A1 through A9999). I wish to record the rseults relationg to each parameter in the adjacent adjacent column (say B1 through B9999). I am then graphing the results. I have currently duplicated the block of code in the several hundred cells (a financial model) as many times as I have parameters. This has limited the number of parameters and created a workbook 110MB+ in size, which is unworkable. I assumed that this could be solved by using a macro, so progressively work down the list of parameters, perform the calculation, and record the results. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how can keep the modified date record in worksheet | Excel Discussion (Misc queries) | |||
Creating a record in one worksheet from the data in another. | Excel Worksheet Functions | |||
Why won't the "record macro" button show on worksheet | Excel Discussion (Misc queries) | |||
What function would move a closed record to another worksheet? | Excel Worksheet Functions | |||
Can I record or write a macro to send a worksheet via Outlook? | Excel Discussion (Misc queries) |