im struggling with some vba code, please help

jonbrom

New member
Joined
Aug 8, 2013
Messages
3
Reaction score
0
Points
0
Sub AddNewProduct()'' AddNewProduct Macro'If ws.Range("C3") = "" ThenMsgBox "add the date"Exit SubElseIf ws.Range("D3") = "" ThenMsgBox "The Category is missing"Exit SubElseIf ws.Range("E3") = "" ThenMsgBox "add the Description"Exit Sub' Range("C3:G3").Select Selection.Copy Range("C5").Select Selection.End(xlDown).Select ActiveCell.Offset(1, 0).Range("A1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveCell.Offset(0, 5).Range("A1").Select Range("H3:J3").Select Application.CutCopyMode = False Selection.Copy ActiveWindow.SmallScroll Down:=0 Range("C5").Select Selection.End(xlDown).Select ActiveWindow.SmallScroll Down:=3 ActiveCell.Offset(1, 5).Range("A1").Select Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False ActiveCell.Offset(0, 3).Range("A1").Select ActiveWindow.SmallScroll Down:=-9 With ws.Range("C6:J10000").Sort Key1:=Sheet3.Range("D6"), Order1:=xlAscending, Header:=xlGuess.Range("M6:M" & Cells(Rows.Count, "M").End(xlUp).Row).Name = "Category"End Sub
 

NoS

New member
Joined
Jan 17, 2013
Messages
832
Reaction score
0
Points
0
Location
British Columbia
Excel Version(s)
Excel 2010
Hello jonbrom

In words, what are you trying to do?
A quick glance and this appears to be a situation for a Userform.
Any chance you could use the "Go Advanced" button and attach an example workbook for us to actually see what you are working with?
 
Top