Simple Macro to repeat on next row on same columns

ilan76

New Member
Joined
Jan 22, 2014
Messages
6
Hi,

I need some help with a simple macro I'm using.
I've recorded a macro which selects a few cells in a row, copies them and pastes them again over the same cells (special paste - only values), and I've attached this macro to a button.
I would like the macro to repeat the same action on the next row for the same columns, each time the button clicked.
How to update the macro to move to the next row each time initiated?

I'll appreciate your help.

Thanks.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Welcome to the Board!

Based in what you are telling me, I can think of a few ways to do this. Which one you choose depends on which one suits your scenario best.
1. Highlight the cells you want to apply it to, and have the macro do it on the Selected Range
2. Have it do it to the entire column(s) you want to apply it
3. Loop through some set of rows (would have to provide the logic in determining which rows to apply it to)

If you post back how you want it to run, and post your VBA code, we can help you modify it.
 
Upvote 0
Hi,

Thanks for your help.
I'm not sure anymore if this the best solution anymore.
What I'm trying to do basically is to maintain the values of some cells (vlookup on updated data from web) ,if they meet a certain condition. just maintain the cells values even when the data keeps updated.
I thought maybe of a macro to copy and paste just the value, I thought maybe using an IF statement when fails will run a VBA on the cell and copy and paste it's value (paste special by value) - don't need to be updated anymore.
Any idea how can I accomplish that? I'll appreciate for any other suggestions as-well.
I'll appreciate for an example.

Thank you.
 
Upvote 0
Perhaps you could post your VBA code, and walk us through an actual example in detail?
 
Upvote 0
Sorry, I don't have an example, I'm not that familiar with VBA, I just wanted to know how I can maintain a value in a cell if a statement is met (or not).
It looks like it should be a simple solution for this but it appears to be not. I tried to search for a simple answer but couldn't find one, even with the 'circular' method which appears to be not very certain.
I just want a cell (which updated by data from web) to be static/not updating anymore, when a certain condition is met. That's it.
I'll appreciate your help.

Thanks.
 
Upvote 0
Sorry, I don't have an example, I'm not that familiar with <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym>
Note that you said this:
I need some help with a simple macro I'm using.
I've recorded a macro which selects a few cells in a row, copies them and pastes them again over the same cells (special paste - only values), and I've attached this macro to a button.
I would like the macro to repeat the same action on the next row for the same columns, each time the button clicked.
How to update the macro to move to the next row each time initiated?
In Excel lingo, "Macros" and "VBA" are synonymous. When you are recording a macro, you are actually creating VBA. If you go into the VB Editor, you will see the VBA code your recorded macro created and you can copy and paste it there.

I just want a cell (which updated by data from web) to be static/not updating anymore, when a certain condition is met.

What is the condition?
Which cell?
How exactly is this cell being updated?

These are the details we are looking for. I figured if you posted your VBA code, it would answer some of them.
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top