Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default find value in one sheet use this as the row to copy the value in c

Hello I have 2 sheets called planning and printing.

I would like to use the value in cell a3 of worksheet printing to search
range e3:e61 in worksheet planning for the same value, (this gets the right
row but I need the value in column A) and with this value in column A, copy
it into worksheet printing cell D3.

Id like to repeat this process going down column a of worksheet printing,
still searching e3:e61 in worksheet planning, copy value in column A and
place it in column D of worksheet printing.

is this possible?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default find value in one sheet use this as the row to copy the value


I ve had a look and I am so confused it is like another language to me. I
must admit even your example is goobledy goop to me. can you suggest anything
else.

cheers
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default find value in one sheet use this as the row to copy the value

A re-read suggests that you are only doing this once so a formula approach
would be better.
Look in excel help for MATCH function to find the row desired. Then look at
INDEX to see how that works and incorporate the match formula within the
index formula.

--
Don Guillett
SalesAid Software

"Paul" wrote in message
...

I ve had a look and I am so confused it is like another language to me. I
must admit even your example is goobledy goop to me. can you suggest
anything
else.

cheers



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default find value in one sheet use this as the row to copy the value



Dear Don I am not doing this once but several times, with 30 columns.

I have this code but it falls down when there is no match

Public Sub test()
Dim cfind As Range
Dim x As Range
Dim cell As Range
Dim myrange As Range
Worksheets("printing").Activate
Set myrange = Range(Range("a3"), Cells(Rows.Count, 1).End(xlUp))
For Each cell In myrange
Worksheets("planning").Activate
With Range("e3:e61")
Set cfind = .Cells.Find(what:=cell.Value, lookat:=xlWhole)
Set x = cfind.End(xlToLeft)
End With
Worksheets("printing").Activate
cell.Offset(0, 3) = x
Next cell
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default find value in one sheet use this as the row to copy the value

Have a try at using

onerror resume next
On Error Statement


Enables an error-handling routine and specifies the location of the routine
within a procedure; can also be used to disable an error-handling routine.

Syntax

On Error GoTo line

On Error Resume Next

On Error GoTo 0

The On Error statement syntax can have any of the following forms:

Statement Description
On Error GoTo line Enables the error-handling routine that starts at
line specified in the required line argument. The line argument is any line
label or line number. If a run-time error occurs, control branches to line,
making the error handler active. The specified line must be in the same
procedure as the On Error statement; otherwise, a compile-time error occurs.
On Error Resume Next Specifies that when a run-time error occurs,
control goes to the statement immediately following the statement where the
error occurred where execution continues. Use this form rather than On Error
GoTo when accessing objects.
On Error GoTo 0 Disables any enabled error handler in the current
procedure.

--
Don Guillett
SalesAid Software

"Paul" wrote in message
...


Dear Don I am not doing this once but several times, with 30 columns.

I have this code but it falls down when there is no match

Public Sub test()
Dim cfind As Range
Dim x As Range
Dim cell As Range
Dim myrange As Range
Worksheets("printing").Activate
Set myrange = Range(Range("a3"), Cells(Rows.Count, 1).End(xlUp))
For Each cell In myrange
Worksheets("planning").Activate
With Range("e3:e61")
Set cfind = .Cells.Find(what:=cell.Value, lookat:=xlWhole)
Set x = cfind.End(xlToLeft)
End With
Worksheets("printing").Activate
cell.Offset(0, 3) = x
Next cell
End Sub



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default find value in one sheet use this as the row to copy the value

also something like this may (NOT tested) be better to remove selections.
NEEDS testing.

Sub test()
Dim cell As Range
Dim myrange As Range

with Worksheets("printing")
Set myrange = .Range(Range("a3"), .Cells(Rows.Count, 1).End(xlUp))
For Each cell In myrange
Worksheets("planning").Range("e3:e61").Find(what:= cell.Value,
lookat:=xlWhole).End(xlToLeft) _
copy .cell.Offset(0, 3)
Next cell
end with
End Sub


--
Don Guillett
SalesAid Software

"Paul" wrote in message
...


Dear Don I am not doing this once but several times, with 30 columns.

I have this code but it falls down when there is no match

Public Sub test()
Dim cfind As Range
Dim x As Range
Dim cell As Range
Dim myrange As Range
Worksheets("printing").Activate
Set myrange = Range(Range("a3"), Cells(Rows.Count, 1).End(xlUp))
For Each cell In myrange
Worksheets("planning").Activate
With Range("e3:e61")
Set cfind = .Cells.Find(what:=cell.Value, lookat:=xlWhole)
Set x = cfind.End(xlToLeft)
End With
Worksheets("printing").Activate
cell.Offset(0, 3) = x
Next cell
End Sub



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default find value in one sheet use this as the row to copy the value

You can just test that the find was successful:

Public Sub test()
Dim cfind As Range
Dim x As Range
Dim cell As Range
Dim myrange As Range
With Worksheets("printing")
Set myrange = .Range(.Range("a3"), .Cells(Rows.Count, 1).End(xlUp))
End With
For Each cell In myrange
With Worksheets("planning").Range("e3:e61")
Set cfind = .Cells.Find(what:=cell.Value, lookat:=xlWhole)
If not cFind is nothing then
Set x = .Cells(cfind.row,1)
Worksheets("printing").Activate
cell.Offset(0, 3).Value = x.Value
Else
' optional:
' cell.offst(0,3).Value = "not found"
end if
End With
Next cell
End Sub

--
Regards,
Tom Ogilvy

"Paul" wrote in message
...


Dear Don I am not doing this once but several times, with 30 columns.

I have this code but it falls down when there is no match

Public Sub test()
Dim cfind As Range
Dim x As Range
Dim cell As Range
Dim myrange As Range
Worksheets("printing").Activate
Set myrange = Range(Range("a3"), Cells(Rows.Count, 1).End(xlUp))
For Each cell In myrange
Worksheets("planning").Activate
With Range("e3:e61")
Set cfind = .Cells.Find(what:=cell.Value, lookat:=xlWhole)
Set x = cfind.End(xlToLeft)
End With
Worksheets("printing").Activate
cell.Offset(0, 3) = x
Next cell
End Sub



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default find value in one sheet use this as the row to copy the value in c

hi Paul

this is a simple one, i did a demo for you, but you address bounced
back, reply to me and i will sent to you

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default find value in one sheet use this as the row to copy the value


Hi danetrak!
thanks for your reply!
I have sent you an email.

my email address is

" wrote:

hi Paul

this is a simple one, i did a demo for you, but you address bounced
back, reply to me and i will sent to you




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default find value in one sheet use this as the row to copy the value



Almost there just have to copy the formatting as well.

Also If the value in worksheet printing is blank, that is the value I am
trying to match in col A is blank I would like the formula to not search for
a value. I would like the result in col D to automatically be blank

thanks again
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default find value in one sheet use this as the row to copy the value

If your working privately with danetrack, don't post in the newgroup please.

--
Regards,
Tom Ogilvy


"Paul" wrote in message
...


Almost there just have to copy the formatting as well.

Also If the value in worksheet printing is blank, that is the value I am
trying to match in col A is blank I would like the formula to not search

for
a value. I would like the result in col D to automatically be blank

thanks again



  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default find value in one sheet use this as the row to copy the value


No I was not working privately.

I don't understand the question

"Tom Ogilvy" wrote:

If your working privately with danetrack, don't post in the newgroup please.

--
Regards,
Tom Ogilvy


"Paul" wrote in message
...


Almost there just have to copy the formatting as well.

Also If the value in worksheet printing is blank, that is the value I am
trying to match in col A is blank I would like the formula to not search

for
a value. I would like the result in col D to automatically be blank

thanks again




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 and copy to another sheet Paul Excel Discussion (Misc queries) 5 September 21st 08 01:36 PM
Find text in cell, copy row to new sheet Ajay Excel Discussion (Misc queries) 6 June 29th 05 08:40 AM
how to find and copy values on sheet 2, based on a list on sheet 1 evanmacnz Excel Programming 4 February 7th 05 08:33 PM
Find and Open Workbook then copy and move sheet cwilson Excel Programming 0 February 2nd 05 07:29 PM
find and copy data from one sheet to another Peter M. Excel Programming 1 November 18th 03 08:36 PM


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