PDA

View Full Version : Modify a macro



sasa
06-07-2008, 01:13 PM
Hi All,
I would ask if it is possible to modify this macro the way it can work always in the same way, in entire column, G in this case, four by four rows, repeatily. In other words, g1->g4, g5->g8, g9->g12 and so on
Thanks in advance
sasa

Simon Lloyd
06-07-2008, 01:29 PM
You will have to explain further as you are using named ranges that aren't dynamic, do you just want to copy the first 4 cells in column A and paste them repeatedly until the end of column G, at the moment your code takes each value one by one and places them in the named range "Input".

Bob Phillips
06-07-2008, 01:49 PM
The code is dynamic, just change the range name definitions

Allowed: =OFFSET(Sheet1!$A$1,1,0,COUNTA(Sheet1!$A:$A)-1,1)

Input: =OFFSET(Sheet1!$G$1,0,0,COUNTA(Sheet1!$A:$A)-1,1)

Simon Lloyd
06-07-2008, 02:43 PM
Bob, of course he needs that for his named ranges (i thought the code looked like yours!), but he wants do some kind of iteration but without further information we're stuck!

sasa
06-07-2008, 10:34 PM
Hi all,
I don't know how I have to use your code, can u be more explicit ?
I agree with Simon Lloyd but my last question posted in Make Decisions may be not so clear to get any answer.

Thanks

sasa

Bob Phillips
06-08-2008, 12:38 AM
You are already using it in that button, so presumably you know what you are doing, I have no idea, I vaguely remember somthing about populating some values based upon a sequence, I presume allowed is the sequence, input is the values,

sasa
06-11-2008, 09:54 PM
Hi All,
Really, after many efforts, I was not able to find the way to modidfy this macro. The macro is good about my needs, what I ask is if it is possible, after I use this one the first time, so with the output in Column G, if I can put again the input items in column A and leaving the column G unchanged, start the macro again considering the value in G4 the first value of the next sequence that should go from G4 to G7 and so on
Any help ?

Thanks

sasa

Bob Phillips
06-12-2008, 12:23 AM
As I keep telling you, you don't need to modify the macro for what you wanted. If you have changed the goalposts, tell us in what way.

sasa
06-12-2008, 06:09 AM
No, what I need is exemplified in the attached file I sent in the previous message but I am in difficulty in achieving it. May be what is easy for you is not for me.

Thanks

sasa

Simon Lloyd
06-12-2008, 11:58 AM
You are only working with a static named range, you have not followed xld's advice and made the named ranges dynamic!. You're code looks to see if there is a blank in your named range and if there is fill it with the first value of your list, if a second blank is found fill it with the second value...etc., in your example you mention sequences but no evidence of such - do you just want to copy every set of 4 values from column A to column G?

sasa
06-12-2008, 12:58 PM
Well, I try to explain what I need
after I put the first values in any of g1:g4, I need to fill the rows in any of g4 :g7 leaving all the names from g1 to g4 and filling the rows in any g5:g7 with the same mechanism used in any of g1:g4 but changing the order of items from a2 to a5 and so on

Thanks
sasa

Simon Lloyd
06-12-2008, 01:32 PM
You have explained nothing!

sasa
06-12-2008, 01:46 PM
Ok I surrender

Simon Lloyd
06-12-2008, 02:02 PM
Make the changes that xld gave then try it and see what the outcome is, you didn't explain what the series in column A would be, adding groups of 4 at the end of data in column G is childsplay!