#1
|
|||
|
|||
BeforeDoubleClick send row to sheet2
Hi Guys,
I have some code that i'm having bother with and could really do with some help please, this is what it does: In sheet 1 I double click on the row of column B and that then sends that row to B33 on sheet 2, or if you click on the row of column C it will send the same row to B61 on sheet 2. The rows on sheet2 are hidden and unhide one by one when the row/s above get populated. The problem is, i have merged columns B,C & D and the code has stopped working, also i don't understand how the code references where the "copy row" starts at? Any help would be much appreciated Thanks |
#2
|
|||
|
|||
Hi Carl
I had a play and see there's merged cells everywhere & as soon as I saw that I stopped. It's best to avoid merged cells like the plague, as merged cells & VBA don't get on very well. The other thing is I think you've changed the layout of sheet 2, or at least enough for the VBA code to not work properly. If you can, settle on how you want it laid out & then do the coding. Coding doesn't compensate for any changes like cell formulas do. The finding the row is done by looking straight up from cell E58 to the first row in column E that has something in it, the Offset(1,0) comes down 1 row from the row with something in. Hope that makes sense lol |
#3
|
|||
|
|||
Instead of merging cells, use Centre Across Selection in the Format Cells / Alignment / Horizontal menu. It gives the same effect without the grief.
|
#4
|
|||
|
|||
Hi Phil,
Thanks for the tip, things are starting to become clearer now lol. The code worked well until i added another two columns into sheet 2 so, I had a bit play with the offset but can only get the values to go into columns D & E instead of B & E. I tried what you suggested above but it didnt give the result unfortunately Carl |
#5
|
|||
|
|||
I changed things about a bit in the top part of the Parts List sheet code, got things to paste into the right cells & changed the deleting code a bit. I've put notes in the code trying to explain what's happening lol. It works as it is now but the Parts List sheet code doesn't have any error control. That means that if something does go wrong it could go into infinite looping or end without enable events being re-enabled, both of which would be a bit of a pain to the user.
I can see you're trying to learn as much as you can as you go so I won't spoil your fun Cheers |
#6
|
|||
|
|||
Phil you're a star!
That works perfectly and the comments are a great help mate, I've been having trouble with that for a while now so you've helped me out alot! Cheers again Carl |
Tags |
vba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
On Click do a search of its contents on sheet2 | mike12 | Excel | 11 | 10-16-2014 04:32 PM |
Transferring info from 1column on sheet2 to sheet1 | rogcar75 | Excel | 22 | 08-26-2014 05:07 PM |
split text files to worksheets (sheet1,sheet2,sheet3 soon sheet 25) | gsrikanth | Excel Programming | 1 | 03-22-2012 11:04 PM |
How to merge two cells from sheet1 to one cell in sheet2 in next sheet | KIM SOLIS | Excel | 6 | 10-30-2011 11:14 PM |
Checking ref # status based on sheet2 ref #. | aligahk06 | Excel | 1 | 04-26-2010 11:22 PM |