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
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
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
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
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
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