Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA help needed

Status
Not open for further replies.

proficy

Technical User
Nov 19, 2002
2
US
Hi,

I am very new to VBA programming. I am doing a small project and need some help with it. my problem is:

1. data in excel cells has to be converted using a simple formula (ex: cell value/n) and written below the original data

2. rearranging data from highest to lowest according to column totals

can somebody help please?

thanks in advance,
proficy.
 
Try playing around with recording a macro, view the code & execute it.

An example to q1 would be

Sub test3()
Range("C8").Select
ActiveCell.FormulaR1C1 = "=R[-1]C/5"
End Sub

 
proficy
this will sort data according to totals in row 11

Code:
Sub Sort()
Selection.Sort Key1:=Range("A11"), Order1:=xlDescending, Header:=xlGuess, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight
End Sub

If you are just starting out with VBA a good way to get some grounding is to record yourself performing some tasks in xl word or whatever. This is how I actually got this code!

To complete what you're trying to achive I think you will need something a little more dymanic than either myself of grungemann have posted here. If this is the case just post back!

;-)

Go TOOLS>MACRO>RECORD NEW MACRO. do some stuff the click the stop button - looks like stop on a VCR or anything like that.

To see what you've done Go TOOLS>MACRO>MACROS.
Select the macro you've just recorded and click edit If a man says something and there are no women there to hear him, is he still wrong?
 
thanks for your help.
I will try the code and will get back to you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top