Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Find & Replace Macro Issues---Please HELP.

First off let me say thanks to anyone that can help me out here. I am
sure my question will be easily answered. I have searched this group
for over an over and haven't found a solution that works that well.
What I am having problem with is a Find & Replace macro updating about
a 1000 corresponding ID's and replacing those numbers with
corresponding names.

I have an Excel document where my data is in column J only that I want
to change. I can't limit the find&replace macro to just that column (I
just don't know code that well).

I have a sheet called "data" that looks like

Column A (ID) Column B (NAME)

25743 Monster House
12790 Cars
54689 Saving Private Ryan

I then have the other sheet that has a column J matching the above
column A data, but separated by a "/"...see below

Column J

25743/12790/54689


What I want is to have the macro look in the "data" sheet and change
the column J in my "inventory sheet" to look like

Monster House/Cars/Saving Private Ryan



I have a list of about a 1000 ID's in A and the names in B in the data
sheet. Again, I only want to change the data in column J on the
inventory sheet.

Can you please help me?

Thanks.

Conor Finnegan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Find & Replace Macro Issues---Please HELP.

If the code as written works on the selection, that would be true, but
most/many people have moved beyond having to select - in which case it
wouldn't.

--
Regards,
Tom Ogilvy


"ufo_pilot" wrote:

Columns("J:J").Select

If I'm not mistaken,
adding this to your macro, before the find/Replace code, should limit the
search to column J
HTH


" wrote:

First off let me say thanks to anyone that can help me out here. I am
sure my question will be easily answered. I have searched this group
for over an over and haven't found a solution that works that well.
What I am having problem with is a Find & Replace macro updating about
a 1000 corresponding ID's and replacing those numbers with
corresponding names.

I have an Excel document where my data is in column J only that I want
to change. I can't limit the find&replace macro to just that column (I
just don't know code that well).

I have a sheet called "data" that looks like

Column A (ID) Column B (NAME)

25743 Monster House
12790 Cars
54689 Saving Private Ryan

I then have the other sheet that has a column J matching the above
column A data, but separated by a "/"...see below

Column J

25743/12790/54689


What I want is to have the macro look in the "data" sheet and change
the column J in my "inventory sheet" to look like

Monster House/Cars/Saving Private Ryan



I have a list of about a 1000 ID's in A and the names in B in the data
sheet. Again, I only want to change the data in column J on the
inventory sheet.

Can you please help me?

Thanks.

Conor Finnegan


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Find & Replace Macro Issues---Please HELP.

Tom...Thanks for your help on this. I am still having issues with it
not replacing everything that falls within the "/"...any ideas as to
how I might fix this issue. Is it a formatting problem, etc? Please
let me know.

Thanks.

Conor

ps - an example view of this is Monster House/12790/Saving Private Ryan

Tom Ogilvy wrote:
Sub ABC()
Dim rng as Range, cell as Range
with Worksheets("Data")
set rng = .Range(.Cells(1,1),.Cells(1,1).End(xldown))
end with

for each cell in rng
Columns(10).Replace What:=cell.value, _
Replacement:=cell.offset(0,1).Value, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
Next
End Sub

Assumes the sheet where the changes to be made is the active sheet when you
run the macro.

--
Regards,
Tom Ogilvy


" wrote:

First off let me say thanks to anyone that can help me out here. I am
sure my question will be easily answered. I have searched this group
for over an over and haven't found a solution that works that well.
What I am having problem with is a Find & Replace macro updating about
a 1000 corresponding ID's and replacing those numbers with
corresponding names.

I have an Excel document where my data is in column J only that I want
to change. I can't limit the find&replace macro to just that column (I
just don't know code that well).

I have a sheet called "data" that looks like

Column A (ID) Column B (NAME)

25743 Monster House
12790 Cars
54689 Saving Private Ryan

I then have the other sheet that has a column J matching the above
column A data, but separated by a "/"...see below

Column J

25743/12790/54689


What I want is to have the macro look in the "data" sheet and change
the column J in my "inventory sheet" to look like

Monster House/Cars/Saving Private Ryan



I have a list of about a 1000 ID's in A and the names in B in the data
sheet. Again, I only want to change the data in column J on the
inventory sheet.

Can you please help me?

Thanks.

Conor Finnegan



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 replace macro edeaston Excel Discussion (Misc queries) 3 January 12th 09 10:51 AM
Find & Replace Macro Rob Wnuk Excel Programming 3 November 5th 06 02:41 AM
Using Find and Replace to replace " in a macro snail30152 Excel Programming 1 April 13th 06 11:58 PM
Help with find and replace macro davegb Excel Programming 5 June 23rd 05 11:31 PM
Using Find & Replace in macro Bob C[_3_] Excel Programming 11 October 30th 03 07:02 PM


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