|
-
Jun 11th, 2004, 07:49 AM
#1
Excel macro [RESOLVED]
I need an Excel macro that does the following:
After I have selected a group of cells with the mouse, I exceute the macro (hotkey = ctrl/something) and the (numeric) contents of all the cells in the range gets divided by 1000. May be easy but I just can't figure out how to do it.
Last edited by krtxmrtz; Jun 14th, 2004 at 01:42 AM.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Jun 12th, 2004, 02:37 PM
#2
VB Code:
'DivideSelectedBy1000
Sub DivideSelectedBy1000()
'Enumerate through the values
Dim c As Integer ' Column Index
Dim r As Integer ' Row Index
For c = 1 To Selection.Columns.Count
For r = 1 To Selection.Rows.Count
Selection.Item(r, c).Value = Selection.Item(r, c).Value / 1000
Next
Next
End Sub
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
Jun 14th, 2004, 01:41 AM
#3
Thanks for guiding me through the jungle of Excel
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|