+ Reply to Thread
Results 1 to 2 of 2

Data Validation not working with macro

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    Reading
    MS-Off Ver
    Excel 2007
    Posts
    15

    Data Validation not working with macro

    I've a macro which is designed to insert a new row at the top of a sheet and have the use select from a list and other cells will be automatically filled in.

    But, somehow the macro has stopped working in part. In cell B2 it should be copying the data validation so the user is forced to pick from a list. But, for some reason it's stopped doing this and now when the macro is run, B2 is simply a free text cell with no validation.

    Can anyone see the problem in the macro:

    Sub Insert_Row2()
    '
    ' Insert_Row2 Macro
    '

    '
    Range("Table2[Logged]").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Rows("2:2").Select
    Application.CutCopyMode = False
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("B2:N2").Select
    Selection.Font.Bold = False
    Range("D2").Select
    ActiveCell.FormulaR1C1 = ""
    Sheets("Reference").Select
    ActiveCell.FormulaR1C1 = ".=IF(C2>"""",NOW(),"""")"
    Sheets("Enter Pipeline Here").Select
    ActiveCell.FormulaR1C1 = "=IF(RC[-1]>"""",NOW(),"""")"

    Also, is there anyway I can lock the cell so users can't bugger about accidently with the validation?

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,789

    Re: Data Validation not working with macro

    Not sure in which cell the validation is present and to which cell you are applying the validation


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1