Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Kenneth Bennett   on Sep 28 In MS Office Category.

  
Question Answered By: Helene Stewart   on Sep 28

I think this does what you want:

Sub RangeToVariant2()
Dim x As Variant
Dim r As Integer, c As Integer, p As Integer
x = Range("A1:C5").Value
For r = 1 To UBound(x, 1)
For c = 1 To UBound(x, 2)
If IsNumeric(x(r, c)) Then
x(r, c) = x(r, c) * 2
End If
Next c
Next r
Range("A1:C5") = x
End Sub

range  with 100 columns and say 245 rows still needs only 2
dimensions to gain access to each cell.

Share: 

 
 
Didn't find what you were looking for? Find more on Array and Range Or get search suggestion and latest updates.


Tagged: