Copy and paste with macro

Last Edited By Krjb Donovan
Last Updated: Mar 05, 2014 09:21 PM GMT

Question

I want to cut the last six digits from one cell and paste it to the one on its right.and down the 2800 rows.how can I do it in one shot using a macro???

Please help. himlink

Answer

Well do you already know the cell references? If you can explicitly refer to each cell address, then it would be (change sheet name and cell references as necessary):

Sub Foo()

With Worksheets("Sheet1")

   .Range("B2800").Value = Right(Range("A1"), 6)

End With

End Sub

If whatever is the activecell, then it would be:

Sub Foozball()

ActiveCell.Offset(2800, 1).Value = Right(ActiveCell.Value, 6)

End Sub

Advertisement

©2024 eLuminary LLC. All rights reserved.