Hello,
I'm trying to write a code that copy's a range on sheet 3 into an active cell on sheet 1
Basically my template is on sheet 3 and i want to right click on a field on sheet 1 and click "new entry"
Thank You
Hello,
I'm trying to write a code that copy's a range on sheet 3 into an active cell on sheet 1
Basically my template is on sheet 3 and i want to right click on a field on sheet 1 and click "new entry"
Thank You
How about a keyboard shortcut? I mean you can add it to the right-click menu if you want, but keyboard short cuts are as easy as:
- Paste code into VB editor, save
- in Excel, press Alt+F8
- Select the macro, then press the Options Button
- type in the keyboard shortcut you want to use (you can even use multiple keys like Ctrl+Shift+R)
Anyway, here's the code, adjust your range on sheet 3 as needed:
Please Login or Register to view this content.
I'm interested in starting a career working with VBA, if anyone knows of any opportunities!
I like the idea of having it on the right click menu
I modified the code in the link you sent me and it works at adding the option to the right click menu but once i click it it tries to search for an old file location and gets an error?
I've attached my spreadsheet to take a look
Change the line in Workbook_Open to:
Please Login or Register to view this content.
That fixed it
Thanks!
I have another question with this code
What if instead of copying to the active cell i instead want to insert and shift rows down?
Adjust the range as necessary.
Please Login or Register to view this content.
I tried that before but for some reason i loose the conditional formatting. Withi do notPlease Login or Register to view this content.
Not sure. I'm not losing conditional formatting in your original file, but that was testing with conditional formatting I made up.
Here take a look at this file. Both New entry and insert new entry are on the right click menu. you'll see what im talking about
So it looks like the conditional formatting isn't being removed, it's just that it's still referencing the cells on Sheet3. Whereas copying the cells doesn't seem to include that sheet reference.
See attached photos.
Line 12-21 were inserted, you can see the sheet 3 references
Line 22-31 were copied, you can see the lack of sheet 3 references
Frankly, I don't know why it does that; I'm no expert in conditional formatting.
I suggest starting a new thread with the title "Inserting vs. Copying cell with conditional formatting. Removing sheet reference when inserting cells from another sheet?"
Explain a little what's going on and link to this thread so people can see what's been applied/tried. A link in this thread to your new thread would also be appreciated.
Sorry I can't be of more help on this one, but I will follow your new thread, as I am curious as to why this happens and how to resolve it.
Insert.pngCopy.png
I greatly appreciate your help and your drive.
I feel like this is bugging you as much as its bugging me lol. i'll post the new thread tomorrow and we'll see what happens.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks