Cut & Paste Need Special Macro

M

Miss Kitty

I have been searching for days on how I can get a macro to copy/cut a row
from one spreadsheet and paste it into another automatically or even when I
run a Macro. The information will come from a validation list with specific
names. This is what I have so far;

With Sheets ("Canvassers")
.Range("D2:N15").Copy Destination: Sheets ("DO NOT CALL List").Range ("A2"
End With

My D column has the validation list in it and I have left my other sheet
completely blank except for a header.

This is working correctly but I seem to be missing something. I need it to
copy/cut ONLY the entire row that has only 1 specific validation name. This
copies/cuts the entire range no matter whats in the validation list.

I welcome anyone's expertise it will be much appreciated!
 
J

Joel

Destination need a := not an =

With Sheets ("Canvassers")
.Range("D2:N15").Copy Destination:=Sheets ("DO NOT CALL List").Range ("A2")
End With
 
D

Dave Peterson

Maybe you could loop through D2:D15 looking for a match for that specific name.

Then copy to the "do not call list" worksheet:

dim DestCell as range
dim myCell as range
dim myRng as range
dim myStr as string

mystr = lcase("Some String to match here")

with worksheets("Canvassers"
set myrng = .range("d2:D15")
end with

for each mycell in myrng.cells
if lcase(mycell.value) = mystr then
with worksheets("do not call list")
set destcell = .cells(.rows.count,"A").end(xlup).offset(1,0)
end with
mycell.entirerow.copy _
destination:=destcell
end if
next mycell

(Uncompiled, untested--watch for typos.)
 
M

Miss Kitty

Thank you I appreciate your prompt reply. But unfortunately it still doesn't
solve my problem for cutting/pasting specific information.
Any suggestions how I would do this?
 
M

Miss Kitty

Sorry Dave can't seem to get it to work. I am not that great with Macros. But
thanks for your help I'll keep plugging along.
 
S

Sheeloo

Send the file to me at (e-mail address removed).

I will write the code and send to you within 24 hours.

Miss Kitty said:
Sorry Dave can't seem to get it to work. I am not that great with Macros. But
thanks for your help I'll keep plugging along.
 

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