LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 113
Default Copy data from one worksheet to another

I'm trying to copy data from one worksheet to another. In the first sheet, there is an ID. I want to find that ID in the second worksheet, and if that ID is found, copy a data into the first sheet. Here is the code I have so far, though it doesn't work. Any help would be greatly appreciated =

Public Sub DateCopy(
Dim x As Intege
Dim tempvar As Strin
Dim tempvar2 As Strin
Dim i As Intege
Dim xlapp1 As Workshee
Dim xlapp2 As Workshee

Set xlapp1 = Workbooks("blah.xls").Worksheets("texting"
Set xlapp2 = Workbooks("blah2.xls").Worksheets("texting2"

For i = 2 To 554
'Application.ScreenUpdating = Fals
'For i = 2 To 200
Set c = Nothin
xlapp1.Activat
xlapp1.Application.Goto reference:=Rows(i).Columns("A"
tempvar = xlapp1.Application.ActiveCell.FormulaR1C
With xlapp2.Range("a1:a2000"
Set c = .Find(what:=tempvar, MatchCase:=True
End Wit
If c Is Nothing The
Els
xlapp2.Activat
x = xlapp2.Application.ActiveCell.Ro
' xlapp2.Application.Goto reference:=Rows(x).Columns("C"
' tempvar2 = xlapp2.Application.Selectio
MsgBox tempvar
xlapp2.Rows(x).Columns("D").FormulaR1C1 = "Yes
xlapp1.Rows(i).Columns("D").FormulaR1C1 = tempvar

' tempvar2 = xlapp2.Rows(Application.ActiveCell.Row).Columns("C ").FormulaR1C
' xlapp2.Rows(Application.ActiveCell.Row).Columns("D ").FormulaR1C1 = "Yes
' xlapp1.Rows(i).Columns("D") = tempvar
End I
Nex
Application.ScreenUpdating = Tru

End Sub
 
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 from B worksheet to A worksheet with NO repeated data tikchye_oldLearner57 Excel Discussion (Misc queries) 1 September 29th 06 06:56 PM
copy data in a cell from worksheet A to worksheet B rajesh Excel Discussion (Misc queries) 1 February 21st 06 07:40 AM
Copy data into a NEW worksheet Krefty Excel Discussion (Misc queries) 1 December 22nd 04 01:53 PM
Copy Modified Worksheet 1 Data to Worksheet 2 clarkelrc Excel Programming 0 April 15th 04 01:36 PM
copy all worksheet data into a new worksheet eric Excel Programming 2 October 2nd 03 08:33 PM


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

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

About Us

"It's about Microsoft Excel"