Posts by major-b

    Hello,

    I have made an macro that loops 3 times a day.
    What it does is very simple.
    It combines 3 *.csv files into one, save it with time and date and remove the original file.
    This is working perfect, but....

    If there are no file in the directory the macro gets corrupt and doesn't know what to do anymore.

    So i think it must check if there is a file in the specified directory and then run the original macro.

    what do you think??

    thanx

    How can I delete sheets in vb code in excel without any other messages.


    This is the code what I use:


    Code
    Sheets("Blad3").Select
        ActiveWindow.SelectedSheets.Delete


    But I get a message "Delete or cancel". I want always to decide for delete without getting the question.

    In a directory are csv files with everyday an other name.
    I want to open these 3 csv-files automaticly and combine these in an xls file on three sheets.


    What i've already try to do is record a macro and import csv file.
    But then it has to be always the same name.


    Does anybody know a VB code for this??

    Hello again,


    I'm using excel 2003 and I searching for a small code to automaticly generate the begin- and end-date of a week (from monday till sunday)
    the only variable that I wanna give is the Weeknumber.


    So if I write a weeknumber in cell(a,1)
    I want the begin-date (monday) in cell (b,1) and
    I want the end-date (sunday) in cell (c,1).


    for example:
    A B C
    1 36
    2 04-09-2006
    3 10-09-2006
    4


    can anybody help me with this??

    Re: CSV file with more than 65536 rows


    hey thanx for your reaction but that doesn't do the trick.
    or i put the vba code not in de proper way.


    I made an button and with vba in excel i'v typed the code in that topic??


    what do I do wrong??

    I have a CSV-file of 30 Megabyte...
    But if I open it in excel he says that he could not open the complete file??


    The maximum rows of excel are 65536.
    Can I enlarge the number of rows that excel can handle or is there anybody with the same problem and wrote an program for it in excel, VB or maybe word??


    I'll hope te hear from you.


    Thanx

    i have a problem?


    If I manually <double click on file> open a CSV file is open correctly and put my data in seperate columns.


    If I run my script it doesn't seperate the data into seperate columns??


    The script is:


    Code
    Workbooks.Open Filename:="C:\TECOTA_10.csv"


    I'll hope any one has an answer on this tread??

    Re: Separator in vba


    yeah you can but it's the same code as i used before.....

    Code
    If wBook Is Nothing Then 'Not open
            
     Workbooks.Open Filename:=pad1_csv + "TEC_10.csv"
     
        End If


    before it worked fine...

    I've reinstalled a PC and want to run my makro again, but......



    If I manually open the *.CSV file it sets my data in the separated coloums.
    But if I open the *.CSV file with the makro it's all data in the same coloum??


    i've checked my reginal settings and i believe that they are correct.


    can anybody help me??

    hello,


    I have a problem.
    The csv files what i use for baches logging is getting to large to import in excel. (larger than 65536 rows)


    I have written a macro to sepparate the batches but if he doesn't read the whole file it is not the correct data.


    How can i Cut data from the csv file (examle between two variables) so that the csv file get's smaller.
    Or break the csv file in two or three parts???


    thanx

    Re: Delete rows in sheet


    I can't thanx you enough.....



    I just changed the code and test it and it works for me too...


    You're great keep up the topics your posts are VERY helpfull.



    My problems are solved

    Re: Delete rows in sheet


    Now It works good for a whole lot....



    But in the do while is still a slight problem.


    he doesn't seen to know what the last cell is??
    Because all the LOT;9999 were deleted only as he reached the last one the code doesn't stop looping so he hang in the loop and then i have to stop the code manually??


    how can i solve this??

    Re: Delete rows in sheet


    Quote from MD7

    I came up with this:



    Appears to work and is a bit shorter than Dave's. Ugly, ugly code though ;o)




    Can't i just rename the sentence Set nrg = thisworkbook.worksheets


    in the sheet where the file is

    Re: Delete rows in sheet


    Sorry Sorry......



    The script works perfect but it has to runs automaticly and that is what i want to know.


    that are indeed the lines what must be deleted