ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   BASIC VBA QUESTION (https://www.excelbanter.com/excel-programming/286256-basic-vba-question.html)

MASON

BASIC VBA QUESTION
 
I am trying to learn visual basic for excel . My first program is to
simply add a column of numbers . The numbers are in column c but I
want to put the result of this sum in column A row 10 . This is my
program so far but this will only put the total on the cell that is
highlighted when I run the macro .

Sub test1

Selection . Insert ("=+c4+c5+c7")

End Sub

Again any help is most appreciated and if someone could point me to a
web site for absolute beginners that would be great .

Sincerely Mason

Dave Peterson[_3_]

BASIC VBA QUESTION
 
One way:

Option Explicit
sub test2()

with activesheet
.range("a10").formula = "=c4+c5+c7"
end with

end sub

And for your reading pleasure, take a look at David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


MASON wrote:

I am trying to learn visual basic for excel . My first program is to
simply add a column of numbers . The numbers are in column c but I
want to put the result of this sum in column A row 10 . This is my
program so far but this will only put the total on the cell that is
highlighted when I run the macro .

Sub test1

Selection . Insert ("=+c4+c5+c7")

End Sub

Again any help is most appreciated and if someone could point me to a
web site for absolute beginners that would be great .

Sincerely Mason


--

Dave Peterson



All times are GMT +1. The time now is 12:21 PM.

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