Hi All, I should attached file with it. about te file - this simple calculator for stock week cover. So input figure in columns "input" and calculate you number of weeks cover. With this file I have 2 problems to resolve: I've made simple macro to calculate week covers (when you inset value in column C in column D macro calculate weeks: Private Sub Worksheet_Change(ByVal Target As Range) Dim KeyCells As Range ' The variable KeyCells contains the cells that will ' cause an macro run when they are changed. Set KeyCells = Range("c3:c300") If Not Application.Intersect(KeyCells, Range(Target.Address)) _ Is Nothing Then ' designated cells has been changed. Call WeekStock End If End Sub
Sub WeekStock() Dim a As Integer, number As Integer a = ActiveCell.Column + 3 Do Until number = 12 If Cells(ActiveCell.Row - 1, a + 5 * number).Value < 0 Then Exit Do number = number + 1 Loop Cells(ActiveCell.Row - 1, ActiveCell.Column + 1).Value = number End Sub Problem #1 (delete): when I delete value in cell - macro calculate me number of weeks cover for row above. and I don't know how to right macro that on click will delete value in next column -> so remove value in cell (column C) and remove value in cell (column D). Problem #2 (ranges): As you see I've only one range ("C3:C300"), but I'd like to have multiple e.g. column H, M, R ... etc. Sorry I'm new to VBA and I'll be appreciated for your help Regards, Pawel From:excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of pawel lupinski Sent: 02 November 2012 5:35 To: excel-macros@googlegroups.com Subject: $$Excel-Macros$$ execute macro on delate Hi All, I need your help on this. I'd like to run macro when I delate value from the cell. So I pushing "delate" and macro run. I couldn't find anything on the web so if you can help me on this. regards, Pawel -- Join official facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES (1120+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. 6) Jobs posting is not allowed. 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en. -- Join official facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES (1120+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. 6) Jobs posting is not allowed. 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en. -- Join official facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES (1120+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. 6) Jobs posting is not allowed. 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en.
delate issue.xlsm
Description: application/vnd.ms-excel.sheet.macroenabled.12