Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Specifying Individual Cells with the Cells Property

Sub UsingCells()      Dim rg As Range      Dim nRow As Integer      Dim nColumn As Integer      Dim ws As Worksheet      Set ws = ThisWorkbook.Worksheets(1)      For nRow = 1 To 10          For nColumn = 1 To 10              Set rg = ws.Cells(nRow, nColumn)              rg.Value = rg.Address          Next      Next       Set rg = Nothing      Set ws = Nothing  End Sub