Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wish to seek advice on this procedure as in
http://www.mvps.org/dmcritchie/excel/insrtrow.htm Hi KC, The explaination for the optional parameters is immeditely below the two procedures at the top of the web page, but here is different wording: The optional parameter is so that you do not need to specify how many rows to insert if called from another macro. The default of zero simply indicates that no choice was made and so you would have to tell it how many rows to insert in your response. Macros with optional parameters perform like functions and will not show up in the list the of macros Alt+F8 (Tools, macro, macros) and so that you will see the macro in that list we need the small macro of the pair of macros. When you invoke macro from Alt+F8 macro list you cannot specify the values for any parameters, hence the need for a default value which essentially says we don't have one so ask me. You might want to read Chip Pearson's page on the difference between Macros and Functions http://www.cpearson.com/excel/differen.htm The following line is to reduce last cell problems, the explanation for the x = Sheets(sht.name).UsedRange.Rows.Count 'lastcell fixup can be found on the link beside it (as seen on web page) in John Walkenbach's Excel Developer Tip: Automatically Resetting the Last Cell (tip 73) http://j-walk.com/ss/excel/tips/tip73.htm The above trick does not alwys work and if you want to fix all pages at once with something more reliable, that fixes all pages in a workbook, and that takes more time (not that you would be bothered by the time when you have such problems) see Debra Dalgleish's page (use the macro, forget about manual method) Why do my scrollbars go to row 500 -- my data ends in cell E50? http://www.contextures.com/xlfaqApp.html#Unused The better place to pick up the actual macro code my pages is from the code directory, which may have additional macros and functions: http://www.mvps.org/dmcritchie/excel/code/insrtrow.txt not included on the descriptive HTML web pages which have explanations and links, in this case http://www.mvps.org/dmcritchie/excel/insrtrow.htm The macro inserts new lines BELOW the original row (row with active cell), so it the original row is moved down additional changes (or deletions) were made or the perception of the original row may be off. Try coloring row and try using marked cells with original addresses in them in your testing, see http://www.mvps.org/dmcritchie/excel/join.htm#markcells --- David McRitchie |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
InsertRowsAndFillFormulas | Excel Programming | |||
InsertRowsAndFillFormulas | Excel Programming | |||
InsertRowsAndFillFormulas Macro | Excel Programming | |||
InsertRowsAndFillFormulas | Excel Programming | |||
InsertRowsAndFillFormulas | Excel Programming |