OyvPet
OyvPet

Reputation: 107

Excel VBA for each selected row change value in column x

This should have been easy, but im struggling.

Looking for a fast code to apply on user selected range.

For each row user has selected set new value in column x.

Upvotes: 1

Views: 2514

Answers (1)

Fadi
Fadi

Reputation: 3322

Try:

Sub Test()
 Dim Rng As Range
 Set Rng = Selection
 For Each rr In Rng.Rows
  Range("X" & rr.Row).Value = "new value"
 Next
End Sub

Upvotes: 3

Related Questions