SBAlexanian
New Member
- Joined
- May 30, 2013
- Messages
- 22
Let me preempt this question with the fact that I am a complete newbie to computer programming, and VBA. I have dabbled in C++ but that really doesn't carry over as much as I had hoped. For some reason, my current employers think a graduate degree in mechanical engineering translates to software engineering Guru.
I have been asked to create an excel program that tracks and updates our current inventory.
What I am trying to do:
There is a sheet with a part code and a rebate value associated with it. There is a separate sheet with a list of our entire inventory organized by these part codes. Our sales team goes in and modifies rebate values in the costing sheets and wants it to update into our inventory sheet.
Here is what I have to this point...
Any Help would be greatly appreciated...
I have been asked to create an excel program that tracks and updates our current inventory.
What I am trying to do:
There is a sheet with a part code and a rebate value associated with it. There is a separate sheet with a list of our entire inventory organized by these part codes. Our sales team goes in and modifies rebate values in the costing sheets and wants it to update into our inventory sheet.
Here is what I have to this point...
Code:
[COLOR=#000000][FONT=arial]Sub GMC_Rebates()[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Application.ScreenUpdating = False[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Sheets("GMC Rebates").Visible = xlSheetVisible[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Sheets("GMC").Visible = xlSheetVisible[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Sheets("GMC").Select[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]ActiveSheet.Range("D2").Select[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Dim j As Integer[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]j = 2[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Do While Cells(j, 4).Value <> ""[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]desc = ActiveCell.Value[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Sheets("GMC Rebates").Select[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]ActiveSheet.Range("A:A").Select[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Selection.Find(what:=desc, After:=ActiveCell, LookIn _[/FONT][/COLOR]
[COLOR=#000000][FONT=arial] :=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _[/FONT][/COLOR]
[COLOR=#000000][FONT=arial] xlNext, MatchCase:=False, SearchFormat:=False).Activate[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]ActiveCell.Offset(0, 1).Select[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Application.CutCopyMode = False[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Selection.Copy[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Sheets("GMC").Select[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]ActiveCell.Offset(0, 14).Select[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]ActiveCell.PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]ActiveCell.Offset(0, -14).Select[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]j = j + 1[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]Loop[/FONT][/COLOR]
[COLOR=#000000][FONT=arial]End Sub[/FONT][/COLOR]