Results 1 to 2 of 2

Thread: im struggling with some vba code, please help

  1. #1

    im struggling with some vba code, please help



    Register for a FREE account, and/
    or Log in to avoid these ads!

    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

  2. #2
    Magician NoS's Avatar
    Join Date
    Jan 2013
    Location
    British Columbia
    Posts
    683
    Articles
    0
    Excel Version
    Excel 2010 64bit
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •