View Single Post
 
Old 10-04-2020, 06:53 PM
leeqiang leeqiang is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Aug 2020
Posts: 53
leeqiang is on a distinguished road
Default

Quote:
Originally Posted by Purfleet View Post
Run it and you will see that in a15 to j15 each column is now a sum of 1:14 as we have not put the $ the ranges are not locked so the columns are relative



The same for the rows



if you want to sum the corner you can just do range(k15) = Sum(a1:j14)



Sub sumthe()

Columns("k:k").ClearContents
Rows("15:15").ClearContents

Range("a15:j15") = "=sum(a1:a14)"
Range("k1:k14") = "=Sum(a1:j1)"
Range("k15") = "=Sum(a1:j14)"
End Sub


thx
Reply With Quote