Hi everybody
I need a macro to copy cell Ai to Bi and continue copying up to empty Ai.
regards
hme
Hi everybody
I need a macro to copy cell Ai to Bi and continue copying up to empty Ai.
regards
hme
Hi
try
hope this helpsSub copy() Dim i As Long i = 1 ' <- - - - - change the value to actual starting row With ActiveSheet Do .Cells(i, 1).copy Destination:=.Cells(i, 2) i = i + 1 Loop Until .Cells(i, 1) = "" End With End Sub
jindon
Hi every body
I use the code suggested by dear Jindon to copy all Ai to Bi up to empty Ai as follow :
Sub copy()
Dim i As Long
i = 1 ' <- - - - - change the value to actual starting row
With ActiveSheet
Do
.Cells(i, 1).copy Destination:=.Cells(i, 2)
i = i + 1
Loop Until .Cells(i, 1) = ""
End With
End Sub
But I need to use a formula assume (Ai /1000 ) and then copy to Bi.
How can I do this?
Your help is much appreciated.
Regards
HME
Hi
I don't understand this meaning.But I need to use a formula assume (Ai /1000 ) and then copy to Bi.
How can I do this?
if you want to start from row 1000 up to next empty cell then
use the code and change start to 1000,
if you want to start from 1st row up to 1000th row then
rgds,Sub copy() Dim i As Long i = 1 ' <- - - - - change the value to actual starting row With ActiveSheet Do .Cells(i, 1).copy Destination:=.Cells(i, 2) i = i + 1 Loop While i<=1000 End With End Sub
jindon
Dear Jindon
Thank you for your help
I mean form row No.1 up to empty Ai. But befor copying to Bi I have to make some calculations for the number inside the cell Ai (for example: dividing to 1000)and then past it to Bi.
Regards
HME
Hi,
I see.......
It is not actually a copy and paste situation, but calculation then.
is it like this?Sub copy() Dim i As Long i = 1 ' <- - - - - change the value to actual starting row With ActiveSheet Do .Cells(i, 2).Value = .Cells(i, 1) / 1000 i = i + 1 Loop While .Cells(i, 1) <> "" End With End Sub
rgds,
jindon
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks