Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Range in FindMethod?


Good Day,

Code below works OK. The problem is that the Range has to be optional
from DG5 DH5 DI5 DJ5 etc. Following seems not to work;
Set MyRange = Range("DG5")
With Sheets("tele").MyRange.CurrentRegion.Columns(1)

Thanks for any hints.

Brgds

CG Rosén
----------------------------------------------------------------------
Dim c
With Sheets("tele").Range("DG5").CurrentRegion.Columns( 1)

Set c = .Find(ComboBox1.Text, LookIn:=xlValues)
If c Is Nothing Then
.Cells(.Rows.Count + 1).Value = ComboBox1.Text
.Cells(.Rows.Count + 1).Offset(0, 1).Value = TextBox3.Text
Else
c.Offset(0, 1).Value = c.Offset(0, 1).Value + TextBox3.Text
End If

End With


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Range in FindMethod?

It would only work if Tele is the activesheet when you do Set MyRange =
Range("DG5")

sStr = "DG5"

with worksheets("Tele").Range(sStr).CurrentRegion.Colum ns(1)

It is unclear how the appropriate cell will be specified.

--
Regards,
Tom Ogilvy

"CG Rosén" wrote in message
...

Good Day,

Code below works OK. The problem is that the Range has to be optional
from DG5 DH5 DI5 DJ5 etc. Following seems not to work;
Set MyRange = Range("DG5")
With Sheets("tele").MyRange.CurrentRegion.Columns(1)

Thanks for any hints.

Brgds

CG Rosén
----------------------------------------------------------------------
Dim c
With Sheets("tele").Range("DG5").CurrentRegion.Columns( 1)

Set c = .Find(ComboBox1.Text, LookIn:=xlValues)
If c Is Nothing Then
.Cells(.Rows.Count + 1).Value = ComboBox1.Text
.Cells(.Rows.Count + 1).Offset(0, 1).Value = TextBox3.Text
Else
c.Offset(0, 1).Value = c.Offset(0, 1).Value + TextBox3.Text
End If

End With




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
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
formula to sort a range so that it matches the exact rows of a column that is outside that range? steveo Excel Discussion (Misc queries) 1 June 18th 06 02:05 AM
how to? set my range= my UDF argument (range vs. value in range) [advanced?] Keith R[_3_] Excel Programming 2 August 11th 03 05:55 PM


All times are GMT +1. The time now is 10:26 PM.

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"