Excel replace text.

  • Thread starter Thread starter xcao
  • Start date Start date
X

xcao

Thanks all.

I'm quite new to Excel, but I'm pretty familiar with Access and vba fo
Access

In Excel where can I add the code for function.

Thank
 
Menu -- Tools - Macro - VB Editor

I hope that helps! Good luck, I have been working on the
same transition for the last few weeks. It's not to bad,
but there are a number of differences.

Kevin
 
xcao said:
Thanks all.

I'm quite new to Excel, but I'm pretty familiar with Access and vba for
Access

In which case, you can do the CASE statement in the sql e.g.

SELECT
MyIntCol,
IIF(MyIntCol=4,'daily','')
& IIF(MyIntCol=8,'weekly','')
& IIF(MyIntCol=16,'monthly','')
AS frequency_text
FROM
MyTable
;

Alternatively,

SELECT
MyIntCol,
CHOOSE(yIntCol,
'','','','daily',
'','','','weekly',
'','','','',
'','','','monthly')
AS frequency_text
FROM
MyTable
;

Jamie.

--
 
.... or even:

SELECT
MyIntCol,
SWITCH(
MyIntCol=4,'daily',
MyIntCol=8,'weekly',
MyIntCol=16,'monthly')
AS frequency_test
FROM
MyTable
;

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top