Help changing a macro - SImple change please help

J

Jeremy

I can record macros like a pro, but editing the code is not for me. see
below code

Range("D1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("D1").Select
Application.CutCopyMode = False
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Range("D1").Select
ActiveCell.FormulaR1C1 = "Coordinator"
Columns("G:G").Select
Selection.Delete Shift:=xlToLeft
Range("H26").Select
ActiveWindow.SmallScroll Down:=-21


This is the part where I selected a cell, nameley D1 and removed the data
validation. How can I change this to affect all of D:D?

Thanks
 
B

Bob Phillips

But then you added it again, but loaded the cell with Coordinator, which
seems pointless to me.

What do you want do to D2 down?
 
S

Susan

try this - just before your data validation coding, change

Range("D1").Select

to this

Range("D:D").Select

that should work (even though you don't need to select, but that's how
you have it, so.......).
:)
susan
 
F

FSt1

hi,
instead of..... Range("D1").Select
make it........ Range("D:D").Select
but you are pasting something in D1 before you are removing the validation
so either move the paste to after the removeal of validation or change the
select to
Range("D2:D65536")

regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top