range calculate

P

pls123

hi all !!! does anybody know how can I place a -range.calculate- inside a
sub like that starts like the next one ?? .. i tryed but didn't work.. TY

Dim aWB As Workbook
Dim aWS As Worksheet

Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")
 
P

Per Jessen

Hi

You don't say exactly what you want to calculate, but this is working:

Sub test()
Dim aWB As Workbook
Dim aWS As Worksheet


Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")


myResult = WorksheetFunction.Sum(aWS.Range("B2:B7"))
aWS.Range("A1") = myResult
End Sub

If this don't help, you need to give us more information about what
you want to do.

Regards,
Per
 
G

Gary''s Student

Sub luxation()
Dim aWB As Workbook
Dim aWS As Worksheet
Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")
Set r = aWS.Range("A1")
r.Calculate
End Sub
 
P

Per Jessen

Sub test()
Dim aWB As Workbook
Dim aWS As Worksheet


Set aWB = ThisWorkbook
Set aWS = aWB.Worksheets("Sheet1")

aWS.Range("A1:B5").Calculate
End Sub

Regards,
Per
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top