![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How to get in a vbs script the sum of values of a Excel cells in a certain range? Assume I want to get the sum of values of all cells from the range "H6:H18" from an Excel Worksheet. How can I do this within vbs script? Claudia |
My System Specs![]() |
| | #2 (permalink) |
| | RE: How to get in a vbs script the sum of values of a Excel cells in a This will definitely work for you. Sub SumRange() Dim myRange As Range Dim cell As Range Dim rngtotal As Double Set myRange = Sheets("Sheet1").Range("H6:H18") For Each cell In myRange rngtotal = rngtotal + cell Next cell MsgBox "The Sum of Range(''H6:H18'') = " & rngtotal End Sub Hope it helps! -- Cheers, Ryan "Claudia d'Amato" wrote: Quote: > Assume I want to get the sum of values of all cells from the range "H6:H18" from an Excel Worksheet. > > How can I do this within vbs script? > > Claudia > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Coloring the cells and text in Excel 7 | Microsoft Office | |||
| a little problem with .Range(.Cells(2,1),.Cells(2,49)). | VB Script | |||
| Excel / .Net: Extract a given Range into Picture or X(HT)ML? | .NET General | |||
| How to delete the content of Excel cells from VBS script? | VB Script | |||
| Can't create uint32 values outside int32 range? | PowerShell | |||