I need to learn Excel VBA, where's a good place to start (website, book...)?
I need a macro to:
A) go down a column testing each cell for a non-number entry, if it is non-number then delete that row.
ex. If (col "A" row "1" = non-num, then delete row, go to next row)
B) go down a second column, summing the next 1 to 12 cells, then performing a calculation, putting the result in a cell next to the sum
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 2/24/2003 by phasty
'
' Keyboard Shortcut: Ctrl+c
'
ActiveCell.Offset(2, 1).Range("A1"
.Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1"
.Select
ActiveCell.FormulaR1C1 = "=SUM(R[-5]C:R[-1]C)"
ActiveCell.Offset(0, -1).Range("A1"
.Select
ActiveCell.FormulaR1C1 = "=RC[1]*0.006"
ActiveCell.Offset(1, 0).Range("A1"
.Select
End Sub
This one works pretty well except for the ones that have a short series of numbers. Then it goes half way into the next series of numbers and does the summation.
Any help would be appreciated.
Thanks,
Phil
I need a macro to:
A) go down a column testing each cell for a non-number entry, if it is non-number then delete that row.
ex. If (col "A" row "1" = non-num, then delete row, go to next row)
B) go down a second column, summing the next 1 to 12 cells, then performing a calculation, putting the result in a cell next to the sum
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 2/24/2003 by phasty
'
' Keyboard Shortcut: Ctrl+c
'
ActiveCell.Offset(2, 1).Range("A1"
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1"
ActiveCell.FormulaR1C1 = "=SUM(R[-5]C:R[-1]C)"
ActiveCell.Offset(0, -1).Range("A1"
ActiveCell.FormulaR1C1 = "=RC[1]*0.006"
ActiveCell.Offset(1, 0).Range("A1"
End Sub
This one works pretty well except for the ones that have a short series of numbers. Then it goes half way into the next series of numbers and does the summation.
Any help would be appreciated.
Thanks,
Phil