Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Cut & Paste Need Special Macro

Send the file to me at .

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

"Miss Kitty" wrote:

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

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Cut & Paste Need Special Macro

Thank you muchly! It is on its way.
--
Miss Kitty


"Sheeloo" wrote:

Send the file to me at .

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

"Miss Kitty" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PASTE SPECIAL w/ Macro Jase Excel Discussion (Misc queries) 7 February 26th 08 06:06 PM
Paste Special Macro - can't undo Ben New Users to Excel 2 May 10th 07 03:44 AM
Copy & Paste Special Macro Secret Squirrel Excel Discussion (Misc queries) 3 January 27th 07 02:15 AM
Copy Paste Special Macro Bud Hughes Excel Discussion (Misc queries) 2 August 31st 05 02:00 AM
Paste Special in a macro CMAC Excel Worksheet Functions 2 December 6th 04 10:19 PM


All times are GMT +1. The time now is 02:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"