Hi Anish
Its not the problem with WHILE or WEND
Make sure you have closed all IF conditions with END IF at proper places
Just check if you have started an IF condition inside the loop and tried to
close it after the loop
2009/10/26 Anish Shrivastava anish@gmail.com
Hello Experts..
I m
Hi Anish,
I also think it's just a mis-count on the End If's
You can simplify your code like this.
Sub dept()
i = 1
z = Cells(Rows.Count, B).End(xlUp).Row
While i = z
If Cells(i, 2).Value Like *FINANCE* Then Cells(i, 4) = FINANCE /
ACCOUNTING: GoTo 100
If Cells(i,
Hi Hemant,
Thanks for your reply. Yea I checked that and made it correct, Actually I
had written numerous number of IF conditions (to be Precise 156) so few
ENDIF's were missing..but now it's working...
Thanks a lot!!!
DIS GROUP ROCKS coz OF PPL LIKE U...
CHeerS
ANISH
On Mon, Oct 26, 2009 at
Thanks Dave,
Looks like we have got another idea to ignore count of ENDIF's ;) ... by the
way wht r disadvantages of using 100 instead of ENDIF??
Cheers!!
ANISH
On Mon, Oct 26, 2009 at 2:23 PM, Dave Bonallack
davebonall...@hotmail.comwrote:
Hi Anish,
I also think it's just a mis-count on the
Hi Anish,
100 is just a label. In this case, it removes the need to add an 'Else' to each
'If Then' since if the 'If' statement is true, then the code jumps to the 100
label. If the statement is false, it just progresses to the next 'If'
statement. This way we save 156 'End If's
Dave.
Date:
Hi Anish
If you are simplifying the code, you can even reduce your code to less than
20 lines from 100s of IF conditions
1) Create a sheet named Replace Values
2) Make 3 columns with the headings:
a) Find Text (col A)
b) Replace Text (col B)
c) Alternative text (col C)
3) Write in (Col A)
Hi,
Why don't you use Select Case instead of IF statement ?
Regards,
Deepak Rai
On Mon, Oct 26, 2009 at 10:47 AM, Anish Shrivastava anish@gmail.comwrote:
Hello Experts..
I m using While and Wend statement in my code and it has got more than 100
if conditions. when I run the macro it
Thanks Andy,
It is working fine with MS office 2007. I use the following code. Thanks for
the support.
Sub Open_All_Files()
Dim oWbk As Workbook
Dim sFil As String
Dim sPath As String
sPath = D:\My Documents\Ajith\VBA\MVL\August\ 'location of files
ChDir sPath
sFil = Dir(*.xls) 'change or add
Dear Macro Experts,
I'm just starting to write a macro. What I'm trying to do is I want to copy
a value from 'computation' sheet.column B and posting it as values in 'Slip'
range D4 and do that while sheet.columnB is not empty. Below is the code
i made but stops.
Sub copyIDtopay()
With
Hi,
Anyone have an idea how to use the maximumscale and minimumscale
objects in VBA to refer to the maximum range of data on an axis?
Thanks.
--~--~-~--~~~---~--~~
--
Some important
We have html files with links in them that open an Excel document and
goes to
a specific worksheet. Since upgrading to Office 2007 we now find that
the
link will only open the spreadsheet to its last saved active
worksheet. Does
anyone know how to get around this? Syntax is a
I am having difficulties following what you would like to do. In
particular it is not clear to me what you mean when you say 'it
stops'. Also, what to you mean to indicate with the - debugs here
flag?
Please post or e-mail example worksheets and I'll take a closer look.
On Oct 26, 6:28 pm,
12 matches
Mail list logo