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!

Excel VBA Code 3

Status
Not open for further replies.
Mar 2, 2006
8
GB
Excel Worksheet:
I want to copy the last data input in Column A and paste into another sheet to the next cell in column A where Column B is Blank.

Can anyone help provide a vba code?

Many Thanks
 

Tools-Macro-Macro Recorder

Record yourself doing it then have a look at the code it produces work from there and com eback to people when you've had a try.

I love deadlines. I like the whooshing sound they make as they fly by
Douglas Adams
(1952-2001)
 
Sorry new to this:

After recording I only have:

ActiveCell.Copy
Sheets("2").Select
Range("A3").Select
ActiveSheet.Paste
Sheets("1").Select
Application.CutCopyMode = False

I need to paste into the next blank cell in a row. i.e. Where the next blank cell in Column B is select coresponding rown number in Column A and paste.

Many Thanks
John
 
Hi
Something like this should do the job

Code:
Worksheets("1").[a65536].End(xlUp).Copy _
Worksheets("2").[a65536].End(xlUp).Offset(1)

Have a look at the help files for the methods used here
eg: copy, end, offset

Oh, and there's a VBA forum which is worth visiting and watching to pick up tips & trcks if you're looking to learn VBA. But first port of call should always be the recorder when setting out on the rocky road to VBA knowledge!!


;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
Thanks very much.

It certainly seems a long road to learn but I'll stick with it.

Thanks Again for your help.
 
Thanks Loomah
I needed that too
how 'bout a star !
[peace]

DougP, MCP, A+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top