Yourself93
New Member
- Joined
- Jun 1, 2016
- Messages
- 41
Hi everyone, looking to see if anyone could help a beginner out with some vba code. I had posted a question previously and have (fortunately) figured out what the issue with that was, however I am now trying to move on to the next part (so let's get to it).
What I have been tasked with at work is to take a template and move a certain piece of it over to a form as it is needed. This template involves form control options buttons. Originally these were linked to cells in the template, however I removed that as I think it will be easier to do what we want with them if we just link them after they are moved. I currently have code that moves these unlinked option buttons to the designated area that is needed. However, what I then need to do is link every option button that is moved to a cell 25 columns to the right of where the option buttons are. I was thinking this could be done with the relative reference excel thing, but am not sure. All cells that have option buttons have 3 different options in them.
So, for example. With my current code I start on Cell A5. Currently in cell A4 it has "C" in it and in cell B4 lets say it has "3". If I run the macro I currently have it inserts a new row by moving everything down a row and copies what is above it for columns A and B (so Cell A5 now have C and Cell B5 now has 3). It also takes the format for the rest of the row and then copies what part of the template I have selected over to this row as well. This means cell J5 will now have 3 grouped option buttons in it. I would then want cell AI to link to these 3 option buttons. (note: You could also have another cell with option buttons in it like J and L so I would need J linked to AI and L linked to AK.) Final note, by selected for the template part I mean the vba code simply has that row chosen. If I wanted something else selected I would need to change the code, so I was just going to make a bunch of macros (one for each row) to deal with this as I do not know how to make that all into one either.
What I have been tasked with at work is to take a template and move a certain piece of it over to a form as it is needed. This template involves form control options buttons. Originally these were linked to cells in the template, however I removed that as I think it will be easier to do what we want with them if we just link them after they are moved. I currently have code that moves these unlinked option buttons to the designated area that is needed. However, what I then need to do is link every option button that is moved to a cell 25 columns to the right of where the option buttons are. I was thinking this could be done with the relative reference excel thing, but am not sure. All cells that have option buttons have 3 different options in them.
So, for example. With my current code I start on Cell A5. Currently in cell A4 it has "C" in it and in cell B4 lets say it has "3". If I run the macro I currently have it inserts a new row by moving everything down a row and copies what is above it for columns A and B (so Cell A5 now have C and Cell B5 now has 3). It also takes the format for the rest of the row and then copies what part of the template I have selected over to this row as well. This means cell J5 will now have 3 grouped option buttons in it. I would then want cell AI to link to these 3 option buttons. (note: You could also have another cell with option buttons in it like J and L so I would need J linked to AI and L linked to AK.) Final note, by selected for the template part I mean the vba code simply has that row chosen. If I wanted something else selected I would need to change the code, so I was just going to make a bunch of macros (one for each row) to deal with this as I do not know how to make that all into one either.