Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Copy cells from two worksheets into one

What I have is workbook that has two worksheets with one cell that could be
the same in both worksheets. If that cell has the same information in both
worksheets I would like to create a third worksheet and copy the information
from both of the other two worksheets into the new one.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Copy cells from two worksheets into one

Sub FindTwoThenAddOne()

Dim Rng As Range
Dim Rng2 As Range
Dim Ws3 As Worksheet

Set Rng = ActiveWorkbook.Worksheets(1).Range("A1")
Set Rng2 = ActiveWorkbook.Worksheets(2).Range("A1")

If Rng = Rng2 Then
Set Ws3 = Worksheets.Add(after:=Worksheets(Worksheets.Count) )
Ws3.Range("A1") = Rng
End If

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Copy cells from two worksheets into one

Thanks I will give it a try.

"David Sisson" wrote:

Sub FindTwoThenAddOne()

Dim Rng As Range
Dim Rng2 As Range
Dim Ws3 As Worksheet

Set Rng = ActiveWorkbook.Worksheets(1).Range("A1")
Set Rng2 = ActiveWorkbook.Worksheets(2).Range("A1")

If Rng = Rng2 Then
Set Ws3 = Worksheets.Add(after:=Worksheets(Worksheets.Count) )
Ws3.Range("A1") = Rng
End If

End Sub


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
Copy Cells from multiple Worksheets in same workbook. OceanSS Excel Discussion (Misc queries) 2 March 16th 10 11:37 AM
Copy cells into worksheets via pull-down [email protected] Excel Discussion (Misc queries) 1 January 12th 07 04:19 AM
enter data once... copy to multiple cells on other worksheets Larry G Excel Discussion (Misc queries) 4 January 3rd 07 06:13 PM
copy specified cells from different worksheets to one worksheet Maarten from Holland Excel Discussion (Misc queries) 2 November 22nd 06 05:31 PM
How to copy multiple cells between worksheets Dominic Excel Discussion (Misc queries) 3 February 1st 06 02:23 PM


All times are GMT +1. The time now is 07:28 AM.

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"