Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Wildcard with constant


I have two sheets, one has part names of companies on and one has th
full names on. I'm trying to replace the part names with the full name
by setting a part name to a constant then searching for it in the othe
sheet, then copying it over. However I can't find a way of using th
find function with a constant and a wildcard entry. Any ideas? Cod
below.


Dim swop As String


swop = ActiveCell
Sheets("Customer List").Select

Range("A2").Select
Cells.Find(What:=swop"*", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows
SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1 (2)").Select
ActiveSheet.Past

--
fugfu
-----------------------------------------------------------------------
fugfug's Profile: http://www.excelforum.com/member.php...fo&userid=2495
View this thread: http://www.excelforum.com/showthread.php?threadid=38713

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Wildcard with constant

Try:

What:=swop & "*"



fugfug wrote:

I have two sheets, one has part names of companies on and one has the
full names on. I'm trying to replace the part names with the full names
by setting a part name to a constant then searching for it in the other
sheet, then copying it over. However I can't find a way of using the
find function with a constant and a wildcard entry. Any ideas? Code
below.

Dim swop As String

swop = ActiveCell
Sheets("Customer List").Select

Range("A2").Select
Cells.Find(What:=swop"*", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1 (2)").Select
ActiveSheet.Paste

--
fugfug
------------------------------------------------------------------------
fugfug's Profile: http://www.excelforum.com/member.php...o&userid=24950
View this thread: http://www.excelforum.com/showthread...hreadid=387138


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Wildcard with constant

Find does not use wildcards. It searches for exact matches or part matches by
changing the parameter

LookAt:=xlPart ' or xlWhole
--
HTH...

Jim Thomlinson


"fugfug" wrote:


I have two sheets, one has part names of companies on and one has the
full names on. I'm trying to replace the part names with the full names
by setting a part name to a constant then searching for it in the other
sheet, then copying it over. However I can't find a way of using the
find function with a constant and a wildcard entry. Any ideas? Code
below.


Dim swop As String


swop = ActiveCell
Sheets("Customer List").Select

Range("A2").Select
Cells.Find(What:=swop"*", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1 (2)").Select
ActiveSheet.Paste


--
fugfug
------------------------------------------------------------------------
fugfug's Profile: http://www.excelforum.com/member.php...o&userid=24950
View this thread: http://www.excelforum.com/showthread...hreadid=387138


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Wildcard with constant

But xlPart will find "asdf" in both:

asdfqwer
and
qwerasdf

(and I think find will support the wildcard.)

Jim Thomlinson wrote:

Find does not use wildcards. It searches for exact matches or part matches by
changing the parameter

LookAt:=xlPart ' or xlWhole
--
HTH...

Jim Thomlinson

"fugfug" wrote:


I have two sheets, one has part names of companies on and one has the
full names on. I'm trying to replace the part names with the full names
by setting a part name to a constant then searching for it in the other
sheet, then copying it over. However I can't find a way of using the
find function with a constant and a wildcard entry. Any ideas? Code
below.


Dim swop As String


swop = ActiveCell
Sheets("Customer List").Select

Range("A2").Select
Cells.Find(What:=swop"*", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1 (2)").Select
ActiveSheet.Paste


--
fugfug
------------------------------------------------------------------------
fugfug's Profile: http://www.excelforum.com/member.php...o&userid=24950
View this thread: http://www.excelforum.com/showthread...hreadid=387138



--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Wildcard with constant

I'll be darned you can use wildcards! I always used xlPart or xlWhole... And
once again I learn something new...
--
HTH...

Jim Thomlinson


"Dave Peterson" wrote:

Try:

What:=swop & "*"



fugfug wrote:

I have two sheets, one has part names of companies on and one has the
full names on. I'm trying to replace the part names with the full names
by setting a part name to a constant then searching for it in the other
sheet, then copying it over. However I can't find a way of using the
find function with a constant and a wildcard entry. Any ideas? Code
below.

Dim swop As String

swop = ActiveCell
Sheets("Customer List").Select

Range("A2").Select
Cells.Find(What:=swop"*", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1 (2)").Select
ActiveSheet.Paste

--
fugfug
------------------------------------------------------------------------
fugfug's Profile: http://www.excelforum.com/member.php...o&userid=24950
View this thread: http://www.excelforum.com/showthread...hreadid=387138


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Wildcard with constant

Please ignore my follow up post to you.

Jim Thomlinson wrote:

I'll be darned you can use wildcards! I always used xlPart or xlWhole... And
once again I learn something new...
--
HTH...

Jim Thomlinson

"Dave Peterson" wrote:

Try:

What:=swop & "*"



fugfug wrote:

I have two sheets, one has part names of companies on and one has the
full names on. I'm trying to replace the part names with the full names
by setting a part name to a constant then searching for it in the other
sheet, then copying it over. However I can't find a way of using the
find function with a constant and a wildcard entry. Any ideas? Code
below.

Dim swop As String

swop = ActiveCell
Sheets("Customer List").Select

Range("A2").Select
Cells.Find(What:=swop"*", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1 (2)").Select
ActiveSheet.Paste

--
fugfug
------------------------------------------------------------------------
fugfug's Profile: http://www.excelforum.com/member.php...o&userid=24950
View this thread: http://www.excelforum.com/showthread...hreadid=387138


--

Dave Peterson


--

Dave Peterson
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
Trying to CF using a wildcard toonarme Excel Discussion (Misc queries) 3 July 18th 10 10:52 PM
Constant loan payments vs. constant payments of principal lalli945 Excel Worksheet Functions 3 December 20th 06 10:33 PM
sum if wildcard Marcel New Users to Excel 1 April 30th 06 11:25 AM
Wildcard fugfug[_10_] Excel Programming 0 July 14th 05 12:34 PM
Wildcard kevin Excel Programming 3 May 25th 04 01:21 PM


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