$$Excel-Macros$$ if statements with several matching values.

2009-11-30 Thread mike
I have a set of data in Excel 2003 that is like this: Customer OrderNum abcdCust 234567 xyzzCust 12345678 ...thousands of order entries, I'm just showing 2 taht are problems for me. The first customer needs to have a padded 7 digit order number as "0234567" The second needs a dash placed betw

Re: $$Excel-Macros$$ if statements with several matching values.

2009-12-23 Thread mike
Well that works if using a formula, how about implementing that using VBA? On Dec 6, 6:17 am, Dilip Pandey wrote: > Dear Mike, > > Below is the formula for your requirement. > > =IF(AND(A2="abcdCust",LEN(B2)=6),0&B2,IF(AND(A2="xyzzCust",LEN(B2)=8),LEFT(­B2,4)&"-"&RIGHT(B2,4),"")) > > Solved workb

Re: $$Excel-Macros$$ if statements with several matching values.

2009-12-23 Thread kvc praveen kumar
Do You want to Use specific VBA coding or else You can use this formula from Dilip directly like this in VBA: Activecell.formula = "=IF(AND(A2="abcdCust",LEN(B2)= > > 6),0&B2,IF(AND(A2="xyzzCust",LEN(B2)=8),LEFT(­B2,4)&"-"&RIGHT(B2,4),""))" On Thu, Dec 24, 2009 at 12:44 AM, mike wrote: > Well

Re: $$Excel-Macros$$ if statements with several matching values.

2009-12-24 Thread Dilip Pandey
Thanks Praveen, I suggest you to take the code to a VB environment and test it. But the approach is good. Dear Mike, the things which matters most is whether our problem is solved or not. If you need the answer in VBA, then you would have mentioned specifically a "VBA Solution Only". I generall

Re: $$Excel-Macros$$ if statements with several matching values.

2009-12-27 Thread mike
Thanks for the input, I do however need a specific VBA solution. -- -- Some important links for excel users: 1. Follow us in TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Excel and VBA Tuto

Re: $$Excel-Macros$$ if statements with several matching values.

2009-12-06 Thread Dilip Pandey
Dear Mike, Below is the formula for your requirement. =IF(AND(A2="abcdCust",LEN(B2)=6),0&B2,IF(AND(A2="xyzzCust",LEN(B2)=8),LEFT(B2,4)&"-"&RIGHT(B2,4),"")) Solved workbook is also attached. Best Regards, -- DILIP KUMAR PANDEY MBA-HR,B COM(Hons.),BCA Mobile: +91 9810929744 dilipan...@gmail.c