Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is it possible?


Hi,

I was wondering if it is possible to copy an entire sheet based on
matching cell values? For example of Have a range of cells in column A
sheet 1 spreadsheet 1. If any of the #'s in the range match cell b2 on
spreadsheet 2, I would like to copy that entire sheet to sheet 2
spreadheet 1.

Any help would be greatly appreciated.

Thanks


--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile: http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=500697

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Is it possible?

Sub CopyData()
Dim rng1 As Range, rng2 As Range

Set rng1 = ActiveSheet.UsedRange
Set rng2 = Worksheets("Sheet2").UsedRange
If ActiveSheet.Evaluate("=SUMPRODUCT(COUNTIF(" & rng1.Address & _
"," & rng2.Address(, , , True) & "))") 0 Then
ActiveSheet.UsedRange.Copy
Worksheets("Sheet2").Select
ActiveSheet.Range("A1").Select
ActiveSheet.Paste
End If

End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"STEVEB" wrote in
message ...

Hi,

I was wondering if it is possible to copy an entire sheet based on
matching cell values? For example of Have a range of cells in column A
sheet 1 spreadsheet 1. If any of the #'s in the range match cell b2 on
spreadsheet 2, I would like to copy that entire sheet to sheet 2
spreadheet 1.

Any help would be greatly appreciated.

Thanks


--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile:

http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=500697



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is it possible?


Hi Bob,

Thanks for your help, I really appreciate it!

I was unable to get the code to work. It was not matching any of the
cells in the range to cell b2 on the other spreadsheet & then copying
the information. Do you have an idea of where I am going wrong?

Thanks again!


--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile: http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=500697

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Is it possible?

Can u post the book somewhere, on the web, not to the NG?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"STEVEB" wrote in
message ...

Hi Bob,

Thanks for your help, I really appreciate it!

I was unable to get the code to work. It was not matching any of the
cells in the range to cell b2 on the other spreadsheet & then copying
the information. Do you have an idea of where I am going wrong?

Thanks again!


--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile:

http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=500697



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is it possible?


Do you have an e-mail I could send it to?


--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile: http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=500697



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Is it possible?

bob dot phillips at tiscali dot co dot uk

do the obvious

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"STEVEB" wrote in
message ...

Do you have an e-mail I could send it to?


--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile:

http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=500697



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



All times are GMT +1. The time now is 04:03 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"