Question:
How do I have excel do a running total.
In other words; I want to be able to type a figure in and excel take the last figure - add
the two figures together - then put the new total under the last/old total?
The following is the macro that will do a running total for you.
Here is how it works.
You select the cell with the last figure in it.
Then run the Macro - You get an input box - type in the new figure - click OK
Sub runtotals()
currentfigure = ActiveCell.Value
Value = InputBox("Type in your amount to add to
running total")
Value2 = Value + currentfigure
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = Value2
End Sub
You get the new total in the cell under the figure you selected.
If you want to automate this a little. Place a button on the worksheet, so all you need to
do is: Select the cell with the last figure then click the button.
If you want to get real automated, you can have it loop until you stop putting something
in the input box.

Want to spruce up Excel charts? Your options are
many. Right-click any element and select the Format option. Under the Patterns
tab, experiment with Fill Effects textures and click OK twice to make a
selection. Use this technique to add an eye-catching background to a bar chart:
Click on the plot area behind the bars, select Format Plot Area, and under the
Picture tab, select an appropriate graphic.

- Turn on your autofilter for your
list.
- Then click Tools, Customize
- Under Categories select View
- Then select Custom Views...
- Drag it up to the toolbar. Then
close the Customized dialog.
- click a down arrow for filtering
(to filter a column)
- Then in the Custom Views text box
type a name to call this view and press enter
Now you have a name for a filtered item. Just
keep adding name to your filtered items.

Just copy this Macro and paste it on a module sheet in Excel 97, 2000,
2002, 2003. Then run the macro "Sort_Active_Book".
Sub Sort_Active_Book()
Dim i As Integer
Dim j As Integer
Dim iAnswer As VbMsgBoxResult
'
' Prompt the user as which direction they wish to
' sort the worksheets.
'
iAnswer = MsgBox("Sort Sheets in Ascending Order?" & Chr(10) _
& "Clicking No will sort in Descending Order", _
vbYesNoCancel + vbQuestion + vbDefaultButton1, "Sort Worksheets")
For i = 1 To Sheets.Count
For j = 1 To Sheets.Count - 1
'
' If the answer is Yes, then sort in ascending order.
'
If iAnswer = vbYes Then
If UCase$(Sheets(j).Name) > UCase$(Sheets(j + 1).Name) Then
Sheets(j).Move After:=Sheets(j + 1)
End If
'
' If the answer is No, then sort in descending order.
'
ElseIf iAnswer = vbNo Then
If UCase$(Sheets(j).Name) < UCase$(Sheets(j + 1).Name) Then
Sheets(j).Move After:=Sheets(j + 1)
End If
End If
Next j
Next i
End Sub

Take all of the code below, from Sub to End Sub and
copy it.
- Open Excel, Click on Tools, Macro, Visual Basic Editor.
- In the Editor, Press the F7 key (this will open a code
window)
- Paste the code in this window.
- Save and return to Excel worksheet.
- Select the column that has all upper case or all lower case.
- Run the macro (Tools, Macro, Macros...)
- Double-Click on the Proper_Case macro.
Sub Proper_Case()
'above name of macro
'the next line selects the column
Range(Selection, Selection.End(xlDown)).Select
'The next line setup the active cell in the selected area as an
individual item. Set C = ActiveCell
' X in the for each loop is really the C or the active cell
' so the macro will follow the selected range to the end
' Loop to cycle through each cell in the specified range.
For Each x In Selection
' There is not a Proper function in Visual Basic for
Applications.
' So, you must use the worksheet function in the following form:
x.Value = Application.Proper(x.Value)
Next
End Sub

Make everything in the
column lower case
Sub Lower_Case()
'above name of the macro
'the next line selects the column(s)
Range(Selection, Selection.End(xlDown)).Select 'The next line setup
the active cell in the selected area as an individual item.
Set C = ActiveCell
' X in the for each loop is really the C or the active cell
' so the macro will follow the selected range to the end
' Loop to cycle through each cell in the specified range.
For Each x In Selection
'LCase is the function to make all letters lower case.
x.Value = LCase(x.Value)
Next
End Sub
|