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

launch macro in other workbook 3
this should work.. 5
fill a cell with this.. 4
error 1004 6
calling sub from other workbook 1
Redefining chart series 1
Loading pivot table problem 3
timer issue 5

Top