Posts by cytop

    Re: Consolidate data from multiple workbooks to one Master Workbook, Code Error


    Quote

    kindly try to solve questions in this forum instead of asking question after question


    http://www.ozgrid.com/forum/showthread.php?t=201109
    http://www.ozgrid.com/forum/showthread.php?t=201096
    http://www.ozgrid.com/forum/showthread.php?t=201082


    and about 7,000 others.


    Quote

    i have observing from my 1st post...

    All 10 of them? Points to a vast experience of forums.


    If you gave the information necessary to resolve an issue it would be extremely helpful - but you continue to post vague messages (post #1 in this thread is a prime example) that defy any attempt to provide a sensible answer. The only option is to ask questions.


    I will accept criticism from you when you can honestly claim to contribute to the forum rather than just take. In the meanwhile, one often used feature on forums is the Ignore button...

    Re: Conditional formatting with VBA


    Good guess - now for the lottery numbers... :)


    One other minor point. Stressed often enough as well. You don't have to select a range in order to process it.

    Code
    For Each x In ThisWorkbook.Sheets("Total").Range("AO17:AO260")

    Re: Consolidate data from multiple workbooks to one Master Workbook, Code Error


    I have no idea what you mean by that, but it doesn't describe how to replicate the error.


    Quote from structo

    are you checked my code?

    No comment.


    Also

    Quote from structo

    why my post is not solved?


    Sending private messages to other members questioning why your post has not been solved is a little counter-productive. No one is obliged to answer any questions and no question is guaranteed to be answered. People tend to avoid when comments like that are chucked into the mix.


    If you really must have a solution then consider posting in the Hire Help forum, noting the conditions of posting in that forum first.

    Re: Conditional formatting with VBA


    Using a phone, so guessing...


    Displayformat is not an Attribute of a cell but a Method which returns an object which represents the display settings for the selected range.


    Delete it. Just refer directly to the cell interior property

    Re: Ready to pay USD $150, if things work properly as needed


    For background info - extracts from PMs

    Quote from zohar

    there webmaster whom mail for permission was sent , is not a full-time employee and has not been there since many days.


    Quote from cytop

    I can't imagine the NSE [National Stock Exchange (India)] website is run by 1 person; someone who "is not a full-time employee and has not been there since many days"


    Quote from zohar

    The problem is that they have not clearly said NO


    Quote from cytop

    I fail to see how you can say that. They emphatically say 'NO' to automated scraping in the T&Cs, unless you have THEIR permission to do so.


    Rather than wasting any more time, this thread is being closed. Feel free to start a new thread when you have the necessary permission and have paid 10% of the offer amount to OzGrid.

    Re: Command Button Auto Click


    Quote

    As i said i don't have knowledge in VBA


    Perhaps, but it's you who will benefit if you take the time to try and understand what code is doing even at the most basic level. You should at least try to understand the concept of looping to avoid recursion. The code, as posted, can bite!

    Re: Using 2 variables in filename to open file


    To start with, this does nothing or at least does nothing other than select each visible cell, in turn, offset from L2:LWhatever:

    Code
    With .Range("L2:L" & kr) 
                For Each c In .Offset(1, 0).Resize(kr - 1).SpecialCells(xlCellTypeVisible) 
                    If c <> "" Then 
                        c.Select 
                         
                    End If 
                Next c 
            End With


    The end result is the cursor will be left in the LAST cell selected, and this is what the variable 'c' will point to.


    You then use c in the HYPERLINK line, but its value never changes - In other words, I really have no idea what this is supposed to do.


    Canned reply - A sample workbook may help.


    [sw]*[/sw]

    Re: Create &amp; Save filtered list into new workbook


    Can't quite follow - it sounds like you want to save a copy of the workbook for each unique name in Sheet2/Col B but the only information in Sheet 2 is the name used for that workbook?
    Upload a sample - it may help to see your data.


    [sw]*[/sw]

    Re: Command Button Auto Click


    That is still vague. One of the tricks of posting on forums is that you precisely describe what you want to do and very clearly state the limiting factors.


    As an example which you will hopefully be able to tweak to your requirements, I'll assume you want the code to loop while cell B1 is less than 10.


    I have no idea what the variable pv is supposed to do/monitor so am ignoring it. It will be updated only once - when the procedure starts.




    There are some subtleties you should be aware of:

    Code
    Do While Range("B1").Value < 10


    Will not execute the code in the loop IF B10 is already >= 10, but

    Code
    Do 
        '// Code here
       Loop While Range("B1").Value < 10


    Will ALWAYS execute the code at least once.


    You can also get rid of the loop building the string txtToWrite


    Code
    txtToWrite = Join(WorksheetFunction.Transpose(Range("A5:A272").Value), vbCrLf)


    Also, you should learn about recursive procedures (Recursion means the procedure calls itself), they can be a very quick way to crash Excel. Your original code (With the 'Open', 'Print' & 'Shell' lines commented out) crashes on my machine after <4000 iterations. It would be best not to use recursion until you understand the limitations.

    Re: Command Button Auto Click


    It won't stop because you do not give it any instruction to stop.


    You need to define what "stop after specific period" means. After 5 minutes? After 5 iterations? After 5:00pm? While information exists in the worksheet...?

    Re: Urgent VBA/Macro help needed!!!!


    Quote

    I need to prepare an Excel file assigned to me on my new Job...


    Good luck with it (Preparing the Excel file). You've alienated most of the active posters on 4 (that I know of) of the main Excel forums by totally ignoring the basic protocols and courtesies expected when you post on free forums; so the chances are you will not receive any help with this.

    Re: Compile Error when setting up Ranges


    Not quite.


    Code
    Dim c as Excel.Range
    
    
    For Each c in Rng3
        if c.value <> vbNullString then c.Value = "*" & c.Value
    Next


    (Code corrected for empty cell check however your code does not match the comment in the code - "'Insert Asterick Before and after Cell Value")

    Re: Compile Error when setting up Ranges


    You also cannot change the individual cells in a range using

    Code
    If rng3.Value <> "" Then rng3.Value = "*" & rng3.Value


    You will have to loop through each cell changing it.


    In-Line IF statements (where the action if the condition is True is on the same physical line as the IF statement) do not need an 'END IF'

    Code
    If rng4.Value <> "" Then rng4.Value = rng4.Value & "*" 
    End If


    Comments only - workbook not downloaded.

    Re: VBA environment variables


    The ENVIRON setting names are strings, exactly as writte in your message text...

    Code
    UserName = LCase(Environ("UserName"))


    You omitted the delimiters in the code.


    This is a good example of why you do not name variables (Username) the same as VBA keywords or other 'System' settings - it gets a little confusing trying to sort errors like that


    You also seem to realise VBA is case sensitive by default. Converting everything to upper/lower case to compare strings is a PITA and one day, in the most important procedure of your programming life, you're going to forget to convert and your wonder application is going to fall over - probably while it is being demonstrated to the MD.


    You can make string comparisons case insensitive by including

    Code
    Option Compare Text

    in the General Declarations section of your module/userform/class module. See Option Compare Statement