Hello, I have probably worded the title wrong but I will try my best to explain what I want to do below.
Basically, the macro has been created to move the data from columns I and J to columns F and G after payment has been received so that it goes round the same cycle each time, and it also removed the Y from column H. You should be able to see this in the code below, the macro has been put in a button where you see the "Click" text, however, I need to be able to do this for each row, is there a way I could use one button and choose the row I want to change each time instead of have the 'Click' on each row.
Or if this isnt possible is there a way so that instead of me manually editing the ranges and copying it down each row, i could place it in a cell and drag it down like I can with formulas.
I hope you understand what Im trying to say, thanks in advance for any help given. And if you do post any code could you please explain it as I am very new to this thanks.
Here is an image of the excel spreadsheet:
\1
Here is the Macro Code:
UPADATE 1:
Chippy provided me with the following which is exactly what I am after except one issue, it doesnt perform the paste special and seems to removed the formulae from the 2 columns thanks, I have managed to put this in a module, so I just need this final tweak:
Originally Posted by
Chippy
Have the button call this routine instead of your code:
Put the code in a module (not a sheet nor workbook module).
UPDATE 2:
Its not the paste special that is the issue it removes the formulas from columns I and J Here are the before and afters:
Attachment 161220
Attachment 161221
UPDATE 3:
Originally Posted by
Chippy
Your PasteSpecial is just pasting values (Paste:=xlPasteValues) which is the same as Range("F2").Value = Range("I2").Value.
Try this instead:
Originally Posted by
Purgatory
Unfortunately that did the following (see file), i.e. seemed to remmove it all so the previous one worked better, thank-you for the help given so far, it is much appreciated.
Attachment 161236
The values was still working it was just the formulas in I and J in the previous code, sorry If i am misunderstanding what you are trying to say.
UPDATE 4:
Originally Posted by
tigeravatar
Chippy's code doesn't use the copy/paste, it uses range.value = range.value, so yes, it's only getting the values and not formulas or formatting.
As for the deletion of the I and J cells, just delete that line (it's this one):
forgot to try this and turns out its completely what I was after, thanks bud and thanks to chippy to for the original code :D
SOLUTION
Bookmarks