Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Using Find to Cut & Paste

I have an index spreadsheet that lists a code number for an item in one
column and the name of the item in a different column. I want to use this
information in different spreadsheets that have only the code numbers. Is it
possible to take a code number in one spreadsheet, search for it in the index
spreadsheet, copy the corresponding name, and paste the name back into the
spreadsheet that just has the codes?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Using Find to Cut & Paste


Sub getdata()

With Sheets("Summary")
RowCount = 1
Do While .Range("A" & RowCount) < ""
ID = .Range("A" & RowCount)
With Sheets("Data")
Set c = .Columns("A").Find(what:=ID, _
LookIn:=xlValues, lookat:=xlWhole)
If c Is Nothing Then
MsgBox ("Did not find ID : " & ID)
Else
Data = c.Offset(rowoffset:=0, columnoffset:=1)
End If
End With
If Not c Is Nothing Then
.Range("B" & RowCount) = Data
End If
Loop

End With

End Sub


"Mark P" wrote:

I have an index spreadsheet that lists a code number for an item in one
column and the name of the item in a different column. I want to use this
information in different spreadsheets that have only the code numbers. Is it
possible to take a code number in one spreadsheet, search for it in the index
spreadsheet, copy the corresponding name, and paste the name back into the
spreadsheet that just has the codes?

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Using Find to Cut & Paste

Assume the code number is in column A and the description
in column B of the Index sheet.
Assume the code number is in column A of all other sheets.


Sub getDescript()
Dim sh As Worksheet, lr As Long, srcRng As Range
lr = Sheets("Index").Cells(Rows.Count, 1).End(xlUp).Row
Set srcRng = Sheets("Index").Range("A2:A" & lr)
For Each sh In ThisWorkbook.Sheets
For Each c In sh.Range("A2:A" & _
Cells(Rows.Count, 1).End(xlUp).Row)
Set i = srcRng.Find(c.Value, LookIn:=xlValues)
If Not i Is Nothing Then
i.Offset(0, 1).Copy c.Offset(0, 1)
End If
Next
Next
End Sub


"Mark P" <Mark wrote in message
...
I have an index spreadsheet that lists a code number for an item in one
column and the name of the item in a different column. I want to use this
information in different spreadsheets that have only the code numbers. Is
it
possible to take a code number in one spreadsheet, search for it in the
index
spreadsheet, copy the corresponding name, and paste the name back into the
spreadsheet that just has the codes?

Thanks!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Using Find to Cut & Paste

Dear Mark

You can use a combination of INDEX and MATCH functions to achieve this.

Workbook INdex.xls Sheet1 contain index numbers and names in ColA and ColB
Current workbook Sheet1 Col A1 = number . Use this formula to retrieve the
name from Index.xls

=IF(ISNA(MATCH(A1,[INDEX]Sheet1!$A$1:$A$3,0))=TRUE,"",INDEX([Book2]Sheet1!$A$1:$B$3,MATCH(A1,[INDEX]Sheet1!$A$1:$A$3,0),2))

If this post helps click Yes
--------------
Jacob Skaria

"Mark P" wrote:

I have an index spreadsheet that lists a code number for an item in one
column and the name of the item in a different column. I want to use this
information in different spreadsheets that have only the code numbers. Is it
possible to take a code number in one spreadsheet, search for it in the index
spreadsheet, copy the corresponding name, and paste the name back into the
spreadsheet that just has the codes?

Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Using Find to Cut & Paste

That worked great, Jakob. Thanks!

"Jacob Skaria" wrote:

Dear Mark

You can use a combination of INDEX and MATCH functions to achieve this.

Workbook INdex.xls Sheet1 contain index numbers and names in ColA and ColB
Current workbook Sheet1 Col A1 = number . Use this formula to retrieve the
name from Index.xls

=IF(ISNA(MATCH(A1,[INDEX]Sheet1!$A$1:$A$3,0))=TRUE,"",INDEX([Book2]Sheet1!$A$1:$B$3,MATCH(A1,[INDEX]Sheet1!$A$1:$A$3,0),2))

If this post helps click Yes
--------------
Jacob Skaria

"Mark P" wrote:

I have an index spreadsheet that lists a code number for an item in one
column and the name of the item in a different column. I want to use this
information in different spreadsheets that have only the code numbers. Is it
possible to take a code number in one spreadsheet, search for it in the index
spreadsheet, copy the corresponding name, and paste the name back into the
spreadsheet that just has the codes?

Thanks!

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
Find Cut and paste kingie Excel Discussion (Misc queries) 4 November 8th 09 08:33 PM
Find/Copy/paste.. then Find/Paste - not working ... at all.... [email protected] Excel Programming 9 November 30th 06 08:49 PM
find and paste ceemo[_2_] Excel Programming 5 July 25th 05 06:10 PM
find and paste TommySzalapski Excel Programming 0 July 25th 05 05:40 PM
I need to find a macro to find data cut and paste to another colu. Rex Excel Programming 6 December 7th 04 09:22 AM


All times are GMT +1. The time now is 06:32 AM.

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"