ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with VBA (https://www.excelbanter.com/excel-programming/375367-help-vba.html)

Jill Thompson

Help with VBA
 
Hi

I have a spreadsheet with lots of columns & I want to add some up and put in
new columns.

At the moment I am using Find to locate the columns,which is working fine,
but then I need to add the formula to each row. So I know I want to add
cols P & col W and put in col X.
Range("X" & ActiveCell.Row & ":X" & iRow).Formula = col P + col w

Can anyone tell me how to do this ?

Thanks
Jill

Otto Moehrbach

Help with VBA
 
Jill
Do you want to merely sum those 2 columns and put the answer in a third
column, or do you want to enter a formula in the third column to do the same
thing? What I'm getting at here is that if you are using VBA anyway, why
not just sum the 2 columns in VBA and be done with it? Then again, there
are times when you might want to put a formula there. HTH Otto
"Jill Thompson" wrote in message
...
Hi

I have a spreadsheet with lots of columns & I want to add some up and put
in
new columns.

At the moment I am using Find to locate the columns,which is working fine,
but then I need to add the formula to each row. So I know I want to add
cols P & col W and put in col X.
Range("X" & ActiveCell.Row & ":X" & iRow).Formula = col P + col w

Can anyone tell me how to do this ?

Thanks
Jill





All times are GMT +1. The time now is 08:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com