Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Looking in 1 list and copying from another lfile


Need help with a smal problem that i´ve ran into .
Im using this for a log report.
Kund = ActiveCell.Value
If Kund < "" Then
Windows("Rtm.csv").Activate
Sheets("rtm").Select

Range("a2").Select

Cells.Find(What:=Kund, After:=ActiveCell, LookIn:=xlFormulas
LookAt _
:=xlPart, SearchOrder:=xlByColumns
SearchDirection:=xlNext, MatchCase:= _
False).Activate
ActiveCell.Offset(0, 5).Range("A1").Select
ErrorAction = ActiveCell.Value
Windows("totalkostnad mot intäkt.xls").Activate
ActiveCell.Offset(0, 7).Range("A1").Select
ActiveCell.Value = ErrorAction
ActiveCell.Offset(1, -7).Range("A1").Select
GoTo HittaKund
End If

And my problem is when there is a number in the first list that+s no
in the second one. Im getting an error mess.
Tried to use "On Error resume next" or "On Error goto 0" but non o
them worked as I wanted.
I need one that is going to the next line in the first list and will d
that until its getting to a empty cell

--
Gadare
-----------------------------------------------------------------------
Gadarel's Profile: http://www.excelforum.com/member.php...fo&userid=1468
View this thread: http://www.excelforum.com/showthread.php?threadid=26310

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Looking in 1 list and copying from another lfile

Dim rng as Range
Kund = ActiveCell.Value
If Kund < "" Then
Windows("Rtm.csv").Activate
Sheets("rtm").Select

Range("a2").Select

set rng =Cells.Find(What:=Kund, After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:=xlNext, MatchCase:= _
False)
if not rng is nothing then
rng.select
ActiveCell.Offset(0, 5).Range("A1").Select
ErrorAction = ActiveCell.Value
Windows("totalkostnad mot intäkt.xls").Activate
ActiveCell.Offset(0, 7).Range("A1").Select
ActiveCell.Value = ErrorAction
ActiveCell.Offset(1, -7).Range("A1").Select
End if
GoTo HittaKund
End If

--
Regards,
Tom Ogilvy

"Gadarel" wrote in message
...

Need help with a smal problem that i´ve ran into .
Im using this for a log report.
Kund = ActiveCell.Value
If Kund < "" Then
Windows("Rtm.csv").Activate
Sheets("rtm").Select

Range("a2").Select

Cells.Find(What:=Kund, After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:=xlNext, MatchCase:= _
False).Activate
ActiveCell.Offset(0, 5).Range("A1").Select
ErrorAction = ActiveCell.Value
Windows("totalkostnad mot intäkt.xls").Activate
ActiveCell.Offset(0, 7).Range("A1").Select
ActiveCell.Value = ErrorAction
ActiveCell.Offset(1, -7).Range("A1").Select
GoTo HittaKund
End If

And my problem is when there is a number in the first list that+s not
in the second one. Im getting an error mess.
Tried to use "On Error resume next" or "On Error goto 0" but non of
them worked as I wanted.
I need one that is going to the next line in the first list and will do
that until its getting to a empty cell.


--
Gadarel
------------------------------------------------------------------------
Gadarel's Profile:

http://www.excelforum.com/member.php...o&userid=14688
View this thread: http://www.excelforum.com/showthread...hreadid=263108



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
Selecting and copying from a list shennigan Excel Discussion (Misc queries) 2 November 14th 08 02:14 PM
Copying different cells from one list to another Imabrit Excel Discussion (Misc queries) 3 July 9th 08 11:03 AM
exel list copying Marc R Sorger CW Excel Discussion (Misc queries) 1 May 9th 06 08:18 PM
Copying list-box control Excel Discussion (Misc queries) 1 January 6th 05 01:39 AM
Copying from list Mortthesport Excel Worksheet Functions 1 November 27th 04 07:24 PM


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