MIDRANGE dot COM Mailing List Archive



Home » PCTECH » November 2010

Re: Excel 2003 question: How to update data in a column conditionally



fixed

Dan -
A macro is the way to go. I may have an example that I can share...
- sjl


Dan wrote:
I have a spreadsheet with approx. 500 rows of data. I need to update a
substring in a column conditioned by values in that column and in another
column. If it were SQL, I might use:

Update "worksheet"
set J1 = substr(J1, 1, 2) + '78' + substr(J1, 5, 6)
where D1 not in ('SRC3', 'UUMC', 'PN', 'FCR1')
and A1 = 22

where J1, D1, & A1 are individual cells in the same row (#1); and I need
this repeated for all 500 rows of data. Essentially, I need to replace the
3rd & 4th character in J1 with '78' when certain conditions are met.

I have no idea how to accomplish this in Excel. I'm guessing a macro is
involved, but my knowledge of them is limited.

Any help or even links to online pointers would be greatly appreciated. I
googled a bunch of terms, but came up with a lot of external data import,
ODBC type of stuff.

- Dan







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact