Hello,
I hope someone can help me.
I'm trying to find a way to split a cell to rows. The no. of rows should be the same as a value inserted on another cell.
I tried to add a picture, hope it will work.
Thanks in advance.
Excel.jpg
Hello,
I hope someone can help me.
I'm trying to find a way to split a cell to rows. The no. of rows should be the same as a value inserted on another cell.
I tried to add a picture, hope it will work.
Thanks in advance.
Excel.jpg
Hello josekr80
Rule No 1 in Excel...Avoid merged cells at all costs they just cause havoc with VBA...
Secondly...A sample upload means so so much more than images...We have no test file to make us of...
What cell what sheet etc etc...The no. of rows should be the same as a value inserted on another cell.
In your sample upload give a Before|After scenario so that we understand what is required...
Good Luck
I don't presume to know what I am doing, however, just like you, I too started somewhere...
One-day, One-problem at a time!!!
If you feel I have helped, please click on the star to left of post [Add Reputation]
Also....add a comment if you like!!!!
And remember...Mark Thread as Solved.
Excel Forum Rocks!!!
Hi there josekr80
try the attached file and tell me what you think.
LE:
I had no other idea but to write code that follows the normal excel behavior. Here is the code I wrote:
The code is triggered as any cell is changed in the sheet.Please Login or Register to view this content.
Last edited by bulina2k; 08-11-2019 at 12:08 PM.
.. and don't forget to have fun!
Bogdan.
mark SOLVED and Add Reputation if my answer pleases you
Sorry for off-topic interjection:
Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.
I'm sure you understand.
EDIT: Thanks for adding extra details.
Last edited by AliGW; 08-11-2019 at 12:13 PM.
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
Hey, it works very good.
I had only 1 issue:when you insert the value 2,3,4 ... the number of rows changes accordingly, that is good. But if you insert 3, and try to change it to 1 or zero, the number of rows stays the same. I mean, you can't bring it back to the original number of rows.
And one more thing, I tried by myself to add more rows on the top of the sheet, for header, etc... and it affects the code. I couldn't change the code by my self. Is there any chance to get a file that the table starts on row number 6? So I''l have some space on the top?
Thanks a lot in advance.
Hi there Josekr,
I modified the code in the NEW.xlsm file that you attached. Now the code takes into consideration the extra column '# of Samples' that you put there.
Now the value 1 takes away the extra rows.
The 2 lines at the end of the code, need the first cell address of the table. (A7) so if you add/subtract extra rows, please modify accordingly.
Inserting rows does not damage the code but inserting columns, especially before the 'no. of bad parts' column, yes it makes the code useless.
So, some requirements for this code to work would be:
- don't insert columns before the triggering column (that is the F column now)
- the Part ID must be filled before using this code.
The modified code is:
Please Login or Register to view this content.
Thank you very much for your time, especially for bulina2K that solved this issue.
It will help me a lot, and I'm learning a lot here.
Have a great day / night.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks