Website Upgrade Incoming - we're working on a new look (and speed!) standby while we finalise the project

Tips on using this forum..

(1) Explain your problem, don't simply post "This isn't working". What were you doing when you faced the problem? What have you tried to resolve - did you look for a solution using "Search" ? Has it happened just once or several times?

(2) It's also good to get feedback when a solution is found, return to the original post to explain how it was resolved so that more people can also use the results.

Excel VBA Help (I didn’t know where else to put it?)

1 reply [Last post]
Tim Colton
User offline. Last seen 14 years 28 weeks ago. Offline
Joined: 23 Mar 2009
Posts: 3
Groups: None
Hello

i was wondering if anyone here has any experiance with writing macros. I have just inherited a project and a lot of the information is in excel spread sheets. This I don’t mind it is just that the previous project manager was a wiz at macros. This means that I now have to learn so. I just need to know how to programme a simple copy and paste loop.

The problem:

I have a table. I need to copy from it the rows of the table and some cells of the cells above the table. The cells above the table need to be repeated for every row. The whole loop needs to be repeated until there is an empty cell at he bottom of the table.

Cheers for your help.

Replies

Rodel Marasigan
User offline. Last seen 4 days 5 hours ago. Offline
Joined: 25 Oct 2006
Posts: 1699
Tim,
You can use record macro in Excel (Tools-> Macro-> Record New Macro)
Then record the task you’re doing and it will automatically write a macro for you. Record the complete task that you want to do. (Single pass task before it goes to same task or loop)
Ex: Highlight row then copy and go to another cell and then paste.

After recording the macro click Stop Macro. Then go to Tools-> Macro-> Visual Basic Editor. Find folder Module on the left (Project Object) and double click Module 1 or any module created. On the right side window panel it show the recorded code. Copy and paste the code in this post so I can understand what do you want to do and I will modify the code to create the loop that you can execute to do the task automatically.

Best Regards,
Rodel