What is vba code to find if an active cell has a button over it?

Closed
Shivam - Mar 29, 2016 at 03:15 AM
Computertech Posts 3569 Registration date Friday February 6, 2015 Status Moderator Last seen July 18, 2016 - Mar 29, 2016 at 04:18 AM
Hello,

In a column, i have a Macro Button for first row.

I have programmed the Macro such that on pressing the Button, a data against the Employee ID entered in First Row gets imported/updated in the respective row under various categories.
To avoid copy paste of a new button for Next Row & Employee ID, i have put in code to paste a new Button in the Next Row of the Column.

My Question is - I need to detect if the below cell already has a button present in the Next Row, so that i can put an if condition, not to paste the button. but only update the details of employee.


A small part of the Code is below


Range("B" & MyRow + n).Select

'I want to put an if condition here if the above selected range has a button, then don't perform the below code & directly End.

ActiveSheet.Shapes.Range(Array("Button 20")).Select
Selection.Copy
Range("B" & MyRow + n).Select
ActiveSheet.Paste
Range("B" & MyRow + n).Select









Related:

1 response

Computertech Posts 3569 Registration date Friday February 6, 2015 Status Moderator Last seen July 18, 2016 893
Mar 29, 2016 at 04:18 AM
Hello,

To provide help, regarding this formula's is not easy one, no body spent time and run the formula's on their own pc and provide help to others, but here in CCM there are some volunteers who provide help in taking time to workout with the formulas you asking for, by executing on their own pc.

Therefore during asking for help you should be polite and responsible of giving respect. Please add Hello (appreciate, grateful, etc.) in the Beginning of your query and ending it by Thank you. So that it is a big thing you did for whom you help.

Hope you understand.

Generally according to our Charter we can't answer the questions who didn't follow our politeness charter. Instead we close that topic.

Please, copy, modify and repost your message respecting the politeness charter.

For CCM politeness charter please read this article:


https://ccm.net/apps-sites/internet-archeology/ccm/10131-terms-of-use-for-ccm-respect-for-others/#politesse

Thanks.
0