Pick a row

  • Thread starter Thread starter myleslawrence
  • Start date Start date
M

myleslawrence

Can anyone tell me how I can I put a value in cell $row$20 where row is the
row with "Summary" in the first column and the column is 20
 
Myles

This will do what you want I think

Sub FindSummary()
Dim rRng As Range
Set rRng = Range("A:A").Find("Summary")
If rRng Is Nothing Then
MsgBox "Summary not found"
Exit Sub
End If
rRng.Offset(0, 20).Value = 12345
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
Try this:
sub summary()
for i = 1 to activesheet.usedrange.rows.count
if range("A" & i) = "Summary" then
range(20, i) = "My Value"
end if
next
end sub
 
Dim rng as Range, rng1 as Range
Dim res as Variant, lRow as long
set rng = Range("A1:A1000")
res = Application.Match("Summary",rng,0)
if not iserror(res) then
set rng1 = rng(res)
lRow = rng1.Row
cells(lRow,20).Value = "a Value"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top