Hi all,
I know I can use =(A1+A2) formula to add the contents of two values together.But I thought I would have a go at doing it with VBA.(not done a great deal with variables in vba)
So I wrote this code(influenced a bit by VB.net) but it just doesn't work
Sub addtwo()
Dim a as Integer
Dim b as Integer
Dim c As integer
Range("A1").Value = a
Range("A2").Value = b
Range("A3").Value = c
c = a + b.
So I place numbers in A1 and A2 on the spreadsheet but when I run the macro nothing happens.
I also tried switching things round like this:
a = Range("A1").Value
But that didn't work either.
I also gave the range it's complete address
Sheet1.Range("A1") etc....but that didn't work either.
I think my logic is near enough but I am obviously missing the point somewhere.
Any help appreciated
Barrow
Bookmarks