Book Home Page Bloglines 1906 CelebrateStadium 2006 OfficeZealot Scobleizer TechRepublic AskWoody SpyJournal Computers Software Microsoft Windows Excel FrontPage PowerPoint Outlook Word ![]() ![]() Host your Web site with PureHost! ![]() |
![]() ![]() Saturday, February 20, 2010 – Permalink – Selection AddressWhat's the count". . . know what range is selected at any given time. You can look at the Name Box, but that only show the active cell." Display number of Rows and Columns See all Topics excel Labels: Customize, Formulas, Macros, Reference, Shortcuts, Tips, VBA <Doug Klippert@ 3:59 AM
Comments:
Post a Comment
Wednesday, September 02, 2009 – Permalink – Dynamic TabsChange tab names automaticallyChanging the names of tabs is easy, just double click the tab or right click and choose rename. Allen Wyatt has a small piece of code that will automatically update the tab name based on the value of a cell in the spreadsheet. Sub myTabName() ActiveSheet.Name = ActiveSheet.Range("A1") End Sub Allen also has some error checking code on his site: Dynamic Worksheet Tabs Dick Kusleika suggests another way using a change event: Naming a sheet based on a cell See all Topics excel <Doug Klippert@ 3:33 AM
Comments:
Post a Comment
Wednesday, August 05, 2009 – Permalink – Large Text FilesSplit between worksheetsWhile this problem is alleviated in Excel 2007 with its 1,048,576 rows by 16,348 columns, The old XL versions are still here. Text files with a large number of records are better handled in a program like Access. Having said that, there can be times that these lists must be imported into Excel. If the file has over 65,536 records, the data will not fit on a single worksheet. Here's a Microsoft Knowledge Base article with the macro code needed to bring oversized text data into Excel and split it into multiple worksheets: Sub LargeFileImport() 'Dimension Variables Dim ResultStr As String Dim FileName As String Dim FileNum As Integer Dim Counter As Double 'Ask User for File's Name FileName = InputBox("Please enter the Text File's name, e.g. test.txt") 'Check for no entry If FileName = "" Then End 'Get Next Available File Handle Number FileNum = FreeFile() 'Open Text File For Input Open FileName For Input As #FileNum 'Turn Screen Updating Off Application.ScreenUpdating = False 'Create A New WorkBook With One Worksheet In It Workbooks.Add template:=xlWorksheet 'Set The Counter to 1 Counter = 1 'Loop Until the End Of File Is Reached Do While Seek(FileNum) <= LOF(FileNum) 'Display Importing Row Number On Status Bar Application.StatusBar = "Importing Row " & _ Counter & " of text file " & FileName 'Store One Line Of Text From File To Variable Line Input #FileNum, ResultStr 'Store Variable Data Into Active Cell If Left(ResultStr, 1) = "=" Then ActiveCell.Value = "'" & ResultStr Else ActiveCell.Value = ResultStr End If 'For Excel versions before Excel 97, change 65536 to 16384 If ActiveCell.Row = 65536 Then 'If On The Last Row Then Add A New Sheet ActiveWorkbook.Sheets.Add Else 'If Not The Last Row Then Go One Cell Down ActiveCell.Offset(1, 0).Select End If 'Increment the Counter By 1 Counter = Counter + 1 'Start Again At Top Of 'Do While' Statement Loop 'Close The Open Text File Close 'Remove Message From Status Bar Application.StatusBar = False End Sub Importing Text Files Larger Than 16,384/65,536 Rows Notice the code about 17 lines from the bottom of the macro. 'For xl97 and later change 16384 to 65536. Also, after import, the data must be parsed. Use Data>Text to columns. If you have not worked with macros before, Dave McRitchie has a tutorial: Getting Started with Macros and User Defined Functions See all Topics excel <Doug Klippert@ 3:13 AM
Comments:
Post a Comment
Friday, May 15, 2009 – Permalink – Tabs with the Number of the WeekCount to 52Excel no longer has a theoretical limit on the number of worksheets in a workbook. One common use of this ability is to add a worksheet for each week in the year. Here's a macro that does the trick: Sub YearWorkbook() Dim iWeek As Integer Dim sht As Variant Application.ScreenUpdating = False Worksheets.Add After:=Worksheets(Worksheets.Count), _ Count:=(52 - Worksheets.Count) iWeek = 1 For Each sht In Worksheets sht.Name = "Week " & Format(iWeek, "00") iWeek = iWeek + 1 Next sht Application.ScreenUpdating = True End Sub ExcelTips.VitalNews.com: Naming tabs for weeks See all Topics excel <Doug Klippert@ 3:58 AM
Comments:
Post a Comment
Tuesday, September 23, 2008 – Permalink – List All FilesAll files in a folderHere is a macro that will produce a list of all the files in a selected folder.
Labels: Macros <Doug Klippert@ 3:20 AM
Comments:
Post a Comment
Thursday, September 04, 2008 – Permalink – Running Total in CommentCircular solutionYou can't have a worksheet formula that looks like this: =C3+C3 But you can do something similar if you use VBA and store the results in another location. "In Microsoft Excel you can avoid circular references when you create a running total by storing the result in a non-calculating part of a worksheet. This article contains a sample Microsoft Visual Basic for Applications procedure that does this by storing a running total in a cell comment."
<Doug Klippert@ 12:06 PM
Comments:
Post a Comment
Wednesday, August 13, 2008 – Permalink – Value of Cell in Headeror FooterThe header and footer cannot contain a link to a cell. You can create and run a macro that will put the value of a cell into a footer or header. You could run this macro each time the contents of the specified cell changes.
Or use it as an Event code:
OzGrid.com: Information from a cell in a worksheet
Excel Basics: Setup Header/Footer
<Doug Klippert@ 4:27 AM
Comments:
Post a Comment
Saturday, July 19, 2008 – Permalink – Run a Macro from CellHow to do the impossible (almost)There are times when it might be nice to run a macro from a cell function. Something like : if a cell has a certain value, a macro will run: =IF(A1>10,Macro1) You can not initiate a macro from a worksheet cell function. However, you can use the worksheet's Change event to do something like this:
Also see: After posting this, Ross Mclean of Methodsinexcel.co.uk came up with a great work around using a User Defined Function.
You can see the simple coding here: Running a macro from a cell. Public Function RMAC _ when invoked by this worksheet formula: =rmac("MyMacro","yada") runs the sub MyMacro with some modification. The Beep is executed, the cell color change is not. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ See all Topics excel <Doug Klippert@ 2:09 AM
Comments:
Post a Comment
Friday, July 18, 2008 – Permalink – Signing MacrosSecurity levelsThere are three levels of Macro security:
"If you've used Access 2003, you've probably seen several security warning messages - Access 2003 cares about your security. An important part of Access 2003 security is digitally signing your code. As Rick Dobson shows, you can do it, but preparing for digital signing is critical. Also: Other links: <Doug Klippert@ 5:00 AM
Comments:
Post a Comment
Tuesday, June 17, 2008 – Permalink – PrintingMacro controlHere are some useful macros concerning Excel and printing. They were written by Ole P. Erlandsen of: ERLANDSEN DATA CONSULTING
See all Topics excel <Doug Klippert@ 5:25 AM
Comments:
Post a Comment
Wednesday, September 19, 2007 – Permalink – Clippy's Revenge pre-2007Roll your own OA
If you want to play with it, see John Walkenbach's Create A Fake Clippy Programming the Office Assistant
With Assistant Here are a few of the actions:
See all Topics excel <Doug Klippert@ 7:45 AM
Comments:
Post a Comment
Friday, August 03, 2007 – Permalink – Undo ExcelLevel talkIn Excel 2007. the number of levels of the "undo stack" was increased from 16 levels to 100. Setting AutoFilters, showing/hiding detail in PivotTables, and grouping/ungrouping in PivotTables are now reversable. And the undo stack is not cleared when Excel saves, be it an AutoSave or a Save by the user. If you think the number of undos should be changed, here's how:
![]() Modify the number of undo levels If you want to clear the undo stack, just run a macro such as: Sub ClearUndo() Allen Wyatt: Clearing the Undo stack See all Topics excel <Doug Klippert@ 6:36 AM
Comments:
Post a Comment
Saturday, March 31, 2007 – Permalink – Comment CodeEdit toolbar
<Doug Klippert@ 7:06 AM
Comments:
Post a Comment
Saturday, March 24, 2007 – Permalink – Splash ScreensA nice sparkleAfter working hours to perfect an Excel project, the last little piece that adds a touch of class, is a splash screen. Here are the instructions to construct this type of user form including a workbook that you can download: Userform - Splash screens Ivan F Moala administers this interesting site called The Xcel Files See all Topics excel <Doug Klippert@ 5:26 AM
Comments:
Post a Comment
Friday, February 16, 2007 – Permalink – Progress GaugeDon't go awayIf your macro is going to take a bit of time to complete, it is good manners to inform your users what is going on. If screen updating is turned off, they may think their machine has frozen. Andy Pope has some great charting examples and also demonstrates a number of Progress meters Here's a static example: ![]() John Walkenbach, also, has tips about how to create a Progress indicator also see: Chip Pearson Dick Kusleika See all Topics excel <Doug Klippert@ 6:35 AM
Comments:
Post a Comment
|