Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Locate all occurrances of a value then transfer to 2nd table on another sheet

To All,

I have 2 identical size tables on two seperate worksheets.
I need to locate <only ALL occurances of the value "S4" in 1st table
and then transfer to the exact same location within the 2nd table on
the 2nd sheet, without overwriting any other data in the 2nd table.

Any directiontal thoughts?

Jim Pellechi
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Locate all occurrances of a value then transfer to 2nd table on another sheet

Try this!

Sub Andoni()
Dim Looked_Value As Variant
Dim C As Range
Dim First_Address As Variant
With Sheets(1)
'This Sheet contain the first Table and the Desired Value
'Range("S4").Value
.Visible = True
.Activate
Looked_Value = .Range("S4").Value
End With
Application.ScreenUpdating = False
With Worksheets(1).Cells 'Put any other range (such a
Range("A1:C14"))
Set C = .Find(Looked_Value, LookIn:=xlValues)
If Not C Is Nothing Then
First_Address = C.Address
Do
Sheets(2).Range(C.Address).Value = Looked_Value
'Sheets(2).Range(First_Address).Select
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address < First_Address
Sheets(2).Range("S4").Value = ""
End If
End Wit

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Locate all occurrances of a value then transfer to 2nd table on another sheet

Andoni,

Thanks so much ... minor tweak to account for identical table size but
at a different location on the 2nd sheet ...

Been spending some time trying to understand/unravel your code which
works flawlessly!!!

Brilliant ... THANKS AGAIN ...

J.Pellechi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
transfer contents from a cell in previous sheet if the sheet is a DarkNight New Users to Excel 1 September 9th 08 01:04 AM
How can I transfer a required data from sheet 1 to sheet 2 automat Malik Nadeem Excel Discussion (Misc queries) 6 October 24th 07 11:48 AM
Transfer/Copy Sheet, Dynamically linked Sheet 0-0 Wai Wai ^-^ Excel Discussion (Misc queries) 2 December 23rd 05 10:04 PM
Locate and retrivie data in table/matrix stefan7219 Excel Worksheet Functions 17 September 17th 05 02:16 AM
Locate all occurrances of a value then transfer to 2nd table on another sheet JimP Excel Programming 0 July 28th 04 12:01 AM


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