Question : Excel VBA count numbers and copy cell

I have an Excel VBA macro that adds numbers to a formula, I need it to count to the end and select and copy the last closest cell to a full multiple of 8.

Answer : Excel VBA count numbers and copy cell

okay, this one is correct...


Sub SelectAndCopy()
[B2].Select
lBrow = Selection.End(xlDown).Row
rVal = Range("A" & lBrow).Value
MyResult = rVal Mod 8

  sRow = (rVal - MyResult) & "#"
    Columns("A:A").Select
    Selection.Find(What:=sRow, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
       
ActiveCell.Offset(0, 1).Select

Selection.Copy

End Sub


Random Solutions  
 
programming4us programming4us