Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default i sent by mistake




Here is the code:

Dim val2 as double
dim val1 as double
Dim val as long
Dim fsheet as string
Dim fnameb as string

Do
ActiveCell.Offset(1, 0).Select
val = ActiveCell.Offset(0, -12).Value
Val1=Activecell.offset(0,11).value
With Workbooks(fnameb).Worksheets(fsheet)
Set rng = .Columns(3).Find(val)and.find(val1)
End With
If Not rng Is Nothing Then
val2 = rng.Offset(0, 11).Value+activecell.offset
(0,11).value


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default i sent by mistake

Dim val2 as double
dim val1 as double
Dim val as long
Dim fsheet as string
Dim fnameb as string
Dim rng1 as Range
Dim rng2 as Range

Do
ActiveCell.Offset(1, 0).Select
val = ActiveCell.Offset(0, -12).Value
Val1=Activecell.offset(0,11).value
With Workbooks(fnameb).Worksheets(fsheet)
Set rng1 = .Columns(3).Find(val)
Set rng2 = .Columns(2).Find(val1)
End With
If Not rng1 Is Nothing Then
if Not rng2 is nothing then
' both val and val1 were found
else
' only val was found
end if
elseif not rng2 is nothing then
'. only val1 was found
else
' neither was found
End if

I don't know what you want to do in each case - so you would need to add
that.

--
Regards,
Tom Ogilvy
"fish" wrote in message
...



Here is the code:

Dim val2 as double
dim val1 as double
Dim val as long
Dim fsheet as string
Dim fnameb as string

Do
ActiveCell.Offset(1, 0).Select
val = ActiveCell.Offset(0, -12).Value
Val1=Activecell.offset(0,11).value
With Workbooks(fnameb).Worksheets(fsheet)
Set rng = .Columns(3).Find(val)and.find(val1)
End With
If Not rng Is Nothing Then
val2 = rng.Offset(0, 11).Value+activecell.offset
(0,11).value




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
where is the mistake? xavi garriga Excel Discussion (Misc queries) 8 September 24th 07 12:06 PM
mistake in formula pm Excel Discussion (Misc queries) 4 January 30th 06 05:31 PM
I saved it by mistake!!!! Ellie Ellis Excel Worksheet Functions 2 November 27th 05 09:40 PM
If I get the help box up by hitting F1 by mistake, how can I get . Last1Standin Excel Discussion (Misc queries) 1 February 17th 05 08:56 PM
Please Correct the mistake Michael168[_45_] Excel Programming 2 November 1st 03 09:20 AM


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