VBA Help


Posted by EAP on December 13, 2001 2:37 PM

Help,
I need a macro that I can use to divide various numbers in an Excel spreadsheet with the click of a button. I have hundreds of lines with numbers in them and I need to divide each of them by the numbers 50, 112, 175, and 238. I need to place each of the result for 50, 112, 175, 238 in separate four separate spreadsheets.

Your help will be greatly appreciated!

Posted by Jacob on December 13, 2001 3:10 PM

Hi

You probably dont need VB for this.

Lets say you have nubers in column A then in column B1 put =A1/50 or A1/112 then fill down. If you need to do more with the numbers post some more info.

Hope this helps

Jacob



Posted by Tom Dickinson on December 13, 2001 4:14 PM

Try this line of code:

Range("D50!" & ActiveCell.AddressLocal) = ActiveCell / 50

The "D50" is the name of the spreadsheet where you want the results. From whay you have stated, you will want to repeat this line, changing the spreadsheet name to whatever you are using, and of course change the divisor (in this example, 50).