Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Cut & Paste Need Special Macro
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! -- Miss Kitty |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Cut & Paste Need Special Macro
Destination need a := not an =
With Sheets ("Canvassers") .Range("D2:N15").Copy Destination:=Sheets ("DO NOT CALL List").Range ("A2") End With "Miss Kitty" wrote: 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! -- Miss Kitty |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Cut & Paste Need Special Macro
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.) Miss Kitty wrote: 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! -- Miss Kitty -- Dave Peterson |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Cut & Paste Need Special Macro
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? -- Miss Kitty "Joel" wrote: Destination need a := not an = With Sheets ("Canvassers") .Range("D2:N15").Copy Destination:=Sheets ("DO NOT CALL List").Range ("A2") End With "Miss Kitty" wrote: 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! -- Miss Kitty |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Cut & Paste Need Special Macro
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. -- Miss Kitty "Dave Peterson" wrote: 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.) Miss Kitty wrote: 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! -- Miss Kitty -- Dave Peterson |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Cut & Paste Need Special Macro
|
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Cut & Paste Need Special Macro
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
PASTE SPECIAL w/ Macro | Excel Discussion (Misc queries) | |||
Paste Special Macro - can't undo | New Users to Excel | |||
Copy & Paste Special Macro | Excel Discussion (Misc queries) | |||
Copy Paste Special Macro | Excel Discussion (Misc queries) | |||
Paste Special in a macro | Excel Worksheet Functions |