#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Excel VBA

I need to write a VBA program (or a macro) that will select a cell from a
worksheet, then look for the same text in a cell in another worksheet (in the
same workbook), then copy another cell in the row that the text is found,
then paste it in the first worksheet.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Starting new thread

Can someone please help me figure out how to start a new thread/question?
There is something I need urgent help with and I have tried for a very long
time. Yes, I am signed in. Yes, i press NEW and then general comment and
question and it does nothing. I would really appreciate your help.

By the way, is there any way to reduce the size of a document map? It is so
large and the type runs off and I can't use it that way.

THANKS.

"Mr. Clean" wrote:

I need to write a VBA program (or a macro) that will select a cell from a
worksheet, then look for the same text in a cell in another worksheet (in the
same workbook), then copy another cell in the row that the text is found,
then paste it in the first worksheet.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Excel VBA

It kind of sounds like you could use =vlookup() or =index(match())--and discard
the macro approach.

Debra Dalgleish has some notes:
http://www.contextures.com/xlFunctions02.html (for =vlookup())
and
http://www.contextures.com/xlFunctions03.html (for =index(match()))

Mr. Clean wrote:

I need to write a VBA program (or a macro) that will select a cell from a
worksheet, then look for the same text in a cell in another worksheet (in the
same workbook), then copy another cell in the row that the text is found,
then paste it in the first worksheet.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,090
Default Excel VBA

How is the first cell selected? For instance, does the user select a cell
and then run the macro?
Where in the first sheet do you want the value placed that came from the
second sheet? HTH Otto
"Mr. Clean" <Mr. wrote in message
...
I need to write a VBA program (or a macro) that will select a cell from a
worksheet, then look for the same text in a cell in another worksheet (in
the
same workbook), then copy another cell in the row that the text is found,
then paste it in the first worksheet.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Excel VBA

I'd like to start at the first row and step through each row of the first
sheet. The worksheet has 300 rows, so I'd like to automate the process.
The value should be at the end of the row selected.

"Otto Moehrbach" wrote:

How is the first cell selected? For instance, does the user select a cell
and then run the macro?
Where in the first sheet do you want the value placed that came from the
second sheet? HTH Otto
"Mr. Clean" <Mr. wrote in message
...
I need to write a VBA program (or a macro) that will select a cell from a
worksheet, then look for the same text in a cell in another worksheet (in
the
same workbook), then copy another cell in the row that the text is found,
then paste it in the first worksheet.






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Starting new thread

RandiBPD: don't choose general comment. Choose New Question.

"RandiBPD" wrote:

Can someone please help me figure out how to start a new thread/question?
There is something I need urgent help with and I have tried for a very long
time. Yes, I am signed in. Yes, i press NEW and then general comment and
question and it does nothing. I would really appreciate your help.

By the way, is there any way to reduce the size of a document map? It is so
large and the type runs off and I can't use it that way.

THANKS.

"Mr. Clean" wrote:

I need to write a VBA program (or a macro) that will select a cell from a
worksheet, then look for the same text in a cell in another worksheet (in the
same workbook), then copy another cell in the row that the text is found,
then paste it in the first worksheet.

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,090
Default Excel VBA

This macro should do what you want. I assumed the following:
Your data starts in row 2 in Column A of the first sheet.
The copied data goes into Column G of the first sheet.
The second sheet is named "Second".
The code searches for the values in Column A of the first sheet.
The code searches IN Column A of the second sheet.
If found, the value in Column G of the second sheet is copied and pasted to
the first sheet.
HTH Otto
Sub CopyData()
Dim RngColAFirst As Range
Dim RngColASecond As Range
Dim i As Range
Set RngColAFirst = _
Range("A2", Range("A" & Rows.Count).End(xlUp))
With Sheets("Second")
Set RngColASecond = _
.Range("A2", .Range("A" & Rows.Count).End(xlUp))
For Each i In RngColAFirst
If Not RngColASecond.Find(What:=i.Value, _
LookAt:=xlWhole) Is Nothing Then
RngColASecond.Find(What:=i.Value, _
LookAt:=xlWhole).Offset(, 6).Copy _
i.Offset(, 6)
End If
Next i
End With
End Sub


"Mr. Clean" wrote in message
...
I'd like to start at the first row and step through each row of the first
sheet. The worksheet has 300 rows, so I'd like to automate the process.
The value should be at the end of the row selected.

"Otto Moehrbach" wrote:

How is the first cell selected? For instance, does the user select a
cell
and then run the macro?
Where in the first sheet do you want the value placed that came from the
second sheet? HTH Otto
"Mr. Clean" <Mr. wrote in message
...
I need to write a VBA program (or a macro) that will select a cell from
a
worksheet, then look for the same text in a cell in another worksheet
(in
the
same workbook), then copy another cell in the row that the text is
found,
then paste it in the first worksheet.






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
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
Open Excel 2003 from Windows Explorer pmpjr Excel Discussion (Misc queries) 9 September 11th 06 03:58 PM
Need suggestions for some uses of Ms Excel Bible John Excel Discussion (Misc queries) 1 February 27th 06 05:30 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
Excel 2002 and 2000 co-install. Control Which Starts ? cnuk Excel Discussion (Misc queries) 2 January 17th 05 08:07 PM


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