I have Columns A Through E being used for a tower of data stacked by months.
The idea is have a list broken up as so:
January:......Name of Expense.......Owed
--------this---is---my---button--------
...................Cable Bill..................$90
..................................Total:......$90
February:.....Name of Expenses.....Owed
--------the----second-----button------
...................Whatever.................$80
....................................Total:.....$80
My button would add specific cells underneath it for more expenses to be entered. My macro worked great for the first one, BUT i have another button underneath it for February and when the rows are changed the macro for the other button is thrown off by 1 row. Somebody told me to do a relational Macro however I'm struggling to do that, it makes cells appear all over the place. I need help. Thanks
A copy of your file and existing procedures would be helpful. Including an after file (what you want it to look like) would be even more helpful. With this, I'd be glad to look at it. Please remove any proprietary information from your files if you choose to post.
J
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
Ok let me make this more clear to what i need help with. Basically im doing a relative reference in order to make a function triggered by the click of a button happen right under it no matter where the button is. Say its on the left side. Right under it will make a new row and merge specific cells. If i moved that button to the right side... it should do the same thing under it on the right. However when i create this type of macro the reference point is the cell selected. If im clicking a button to activate this any cell i have selected b4 will be affected, rather making it happen under it. I tried editing the code to make the button itself the reference point however im not sure how to do this. So my question is simple. How do I make the button i click the starting point of my macro? Not the cell. Because the cells change and the buttons don't.
If thats not possible maybe a command to select the cell that is right under or behind the button thats being clicked would help.
Sorry, don't understand your issue so I'm unable to help.
J
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
Hello Jackel159,
Welocme to the Forum!
Create your buttons using the Forms Toolbar and attach this macro to each button.
Code:Sub AddRowBelow() Dim Btn As Excel.Button Set Btn = ActiveSheet.Buttons(Application.Caller) With Btn.TopLeftCell Btn.Left = .Left Btn.Top = .Top .EntireRow.Offset(1, 0).Insert End With End Sub
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks