#1   Report Post  
Scott
 
Posts: n/a
Default REPLACE Function

Hello,

We have a spreadsheet that has a Web Query that imports the names of the
states into Column A1 to A50. It imports New York as "New York", however
this does not work for us, as we need it to read "NY". Is there something I
can use to automate this change? Right now we are doing it manually.
The other problem is, New York is not always in the same cell. It could be
in A3 one day and A48 the next. So I'd need a function that searches the
whole column and replaces the occurance of "New York" with "NY".

Thank you.

  #2   Report Post  
Gary''s Student
 
Posts: n/a
Default REPLACE Function

As you are aware the Find / Replace feature can easily change all ocurances
of NEW York to NY in column A.

To automate this, turn on the Macro Recorder, select column A, perform the
Find / Replace, and then turn off the macro recorder. Whenever you refresh
the data you can run the macro and do the replacements automatically.
--
Gary''s Student


"Scott" wrote:

Hello,

We have a spreadsheet that has a Web Query that imports the names of the
states into Column A1 to A50. It imports New York as "New York", however
this does not work for us, as we need it to read "NY". Is there something I
can use to automate this change? Right now we are doing it manually.
The other problem is, New York is not always in the same cell. It could be
in A3 one day and A48 the next. So I'd need a function that searches the
whole column and replaces the occurance of "New York" with "NY".

Thank you.

  #3   Report Post  
Scott
 
Posts: n/a
Default REPLACE Function

Thanks for the suggestion. I would prefer it, if there were a way to just
have NEW YORK change to NY when the data is brought in during the web query.
Can that be accomplished?

Thanks


"Gary''s Student" wrote:

As you are aware the Find / Replace feature can easily change all ocurances
of NEW York to NY in column A.

To automate this, turn on the Macro Recorder, select column A, perform the
Find / Replace, and then turn off the macro recorder. Whenever you refresh
the data you can run the macro and do the replacements automatically.
--
Gary''s Student


"Scott" wrote:

Hello,

We have a spreadsheet that has a Web Query that imports the names of the
states into Column A1 to A50. It imports New York as "New York", however
this does not work for us, as we need it to read "NY". Is there something I
can use to automate this change? Right now we are doing it manually.
The other problem is, New York is not always in the same cell. It could be
in A3 one day and A48 the next. So I'd need a function that searches the
whole column and replaces the occurance of "New York" with "NY".

Thank you.

  #4   Report Post  
Gary''s Student
 
Posts: n/a
Default REPLACE Function

It is definitely possible to extend the macro to include bring in the web
material, performing general formatting as well as the text conversion. I
have no experience with web queries.

I suggest you create a new posting in the programming section.
--
Gary''s Student


"Scott" wrote:

Thanks for the suggestion. I would prefer it, if there were a way to just
have NEW YORK change to NY when the data is brought in during the web query.
Can that be accomplished?

Thanks


"Gary''s Student" wrote:

As you are aware the Find / Replace feature can easily change all ocurances
of NEW York to NY in column A.

To automate this, turn on the Macro Recorder, select column A, perform the
Find / Replace, and then turn off the macro recorder. Whenever you refresh
the data you can run the macro and do the replacements automatically.
--
Gary''s Student


"Scott" wrote:

Hello,

We have a spreadsheet that has a Web Query that imports the names of the
states into Column A1 to A50. It imports New York as "New York", however
this does not work for us, as we need it to read "NY". Is there something I
can use to automate this change? Right now we are doing it manually.
The other problem is, New York is not always in the same cell. It could be
in A3 one day and A48 the next. So I'd need a function that searches the
whole column and replaces the occurance of "New York" with "NY".

Thank you.

  #5   Report Post  
Arvi Laanemets
 
Posts: n/a
Default REPLACE Function

Hi

Add a sheet with all places, with both full name and short name in it. Like
Sheet City:
FullName ShortName
New York NY
Chicago Chicago
New Orleans NO

Into next column to right of your query table enter the formula like
=VLOOKUP(A1,City!$A$2:$B$100,2,0)
Copy the formula to all rows with returned query data
In query data range properties, set adjacent formulas to be refreshed, and
cells with new data to be overwritten.


--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )


"Scott" wrote in message
...
Hello,

We have a spreadsheet that has a Web Query that imports the names of the
states into Column A1 to A50. It imports New York as "New York", however
this does not work for us, as we need it to read "NY". Is there something
I
can use to automate this change? Right now we are doing it manually.
The other problem is, New York is not always in the same cell. It could be
in A3 one day and A48 the next. So I'd need a function that searches the
whole column and replaces the occurance of "New York" with "NY".

Thank you.



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
VBA function for "Mean" using Array as argument ASokolik Excel Worksheet Functions 21 March 28th 06 10:05 PM
creating function (vba) with range arguments Fredouille Excel Worksheet Functions 2 September 12th 05 11:01 AM
REPLACE outside of highlighted column Jane Excel Worksheet Functions 8 May 19th 05 01:54 PM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 01:28 AM.

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"