Thread: range and sum?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default range and sum?

bk.Worksheets(1).Range("A1").Value = _
Worksheets(1).Range("A38").Value + Worksheets(1).Range(";A41").Value


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ole" wrote in message
...
Hi NG.

I have the following code:

""Sub Makro1()

Dim bClose As Boolean
Dim bk As Workbook
On Error Resume Next
Set bk = Workbooks("Master.xls")
On Error GoTo 0
If bk Is Nothing Then
bClose = True
Set bk = Workbooks.Open("C:\Master.xls")
End If
bk.Worksheets(1).Range("A1).Value = _
Worksheets(1).Range(A1).Value
bk.Save
If bClose Then
bk.Close Savechanges:=False
End If
Application.EnableEvents = False
ThisWorkbook.Save
Application.EnableEvents = True

End Sub""

Now i want to copy the SUM of A38 and A41 to my master.xls, but everything
i
tries failes. someting like this:

bk.Worksheets(1).Range("A1").Value = _
Worksheets(1).Range(=SUM("A38;A41")).Value

I have tried many other things but nothing works, btw. its numbers i have
to
sum.

I hope you have an idea.

Regards,
Ole


--
Jeg beskyttes af den gratis SPAMfighter til privatbrugere.
Den har indtil videre sparet mig for at få 24 spam-mails.
Betalende brugere får ikke denne besked i deres e-mails.
Hent den gratis her: www.spamfighter.dk