View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
mudraker[_98_] mudraker[_98_] is offline
external usenet poster
 
Posts: 1
Default select column cell in same row as loop result?

John

I failed to fix all the errors in my first posting
I should have changed all Cell.row entries to be c.row

I fixed in the last part of the macro & not in the first part in m
reposted macro



Sub cfffg()
Dim c As Range
For Each c In Selection
Select Case UCase(c)
Case "115297" ': then insert into A "22" and insert into I "23"
Range("a" & c.Row).Value = "22"
Range("i" & c.Row).Value = "23"

Case "276534" ' : then insert into A "27" and insert into I "93"
Range("a" & c.Row).Value = "27"
Range("i" & c.Row).Value = "93"

'Case "" 'then insert into A "999" and insert into I "999"

Case ""
Range("a" & c.Row).Value = "999"
Range("i" & c.Row).Value = "999"
Exit For
End Select
Next
End Su

--
Message posted from http://www.ExcelForum.com