Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to Transfer Figures 1

Status
Not open for further replies.

APElliott

Technical User
Jul 9, 2002
165
GB
Hello,

Can any one help me?

I have a column of figures. I want to copy say c1 to a1 perform an macro code then delete a1. I then want to transfer c2 to a2 and perform the same macro code then delete a2 and so on to the 'end' of column c.

Thanks in advance.

Any queries please ask!

Andrew
 
I'm not sure what Macro you want to run, but the following code might help:

Code:
Sub CopyColC2A()
Range("C1").Select
Do Until ActiveCell.Value = ""
    ActiveCell.Copy Destination:=ActiveCell.Offset(0, 1)
    'run your Macro
    ActiveCell.Offset(1, 0).Select
Loop
Range("C1").Select
End Sub

Hope this helps!



If you can't be "The Best", be the best at what you can!!!

Never say Never!!!
Nothing is impossible!!!
 
OOPS,

Sorry, I am half asleep and it is Friday.

Code:
Sub CopyColC2A()
Range("C1").Select
Do Until ActiveCell.Value = ""
    ActiveCell.Copy Destination:=ActiveCell.Offset(0, -2)
    'run your Macro
    ActiveCell.Offset(0, -2).ClearContents
    ActiveCell.Offset(1, 0).Select
Loop
Range("C1").Select
End Sub

My Bad! :)




If you can't be "The Best", be the best at what you can!!!

Never say Never!!!
Nothing is impossible!!!
 
Cheers - works a treat.

That the first part you've solved. I'll be posting another for you soon.

Once again, cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top