Posts by Raghulan

    Hi All,
    I want to write a query string into a text file based on the length factor and comma.
    sample query:
    Insert in db.table 1 (col1_name, col2_name,col3_name,col4_name,col5_name) values ('col1values','col2value','col3value','col4value','col5value');


    lets say while writing the first line the 70th char is 5 in Col5_name, i dont want to cut the column name in the first line as col5 and write the second line as _name.
    I want to bring the column col5_name in the next line and stop the first line ending with comma. I am ok if my first line is less than 70 column.


    Please help. Thanks!!!

    Hi Carim,
    As I said previously , am new to VBA and just started working on macro this year. With the help of google I learned the basic things, but coding wise its still a complex thing for me.
    Still i could not understand what is the object variable. How it is used. I ran your code step by step, I could understand that the cells A,b & C or concatenated and verify for the match , then created to a temporary table and from there writing it to next sheet.


    Also in the Range in column A, its hardcoded, what if the range varies. I tried to use an object to set the range, but it did not work for me. I need the below code to be used for any number of rows in column A.


    For Each c In Sheet1.Range("A2:A18")

    Hi,
    I am very new to excel VBA.
    I dont know how to extract a first row values if there are multiple distinct values in one of the column and same values in rest of the columns. Then paste the first row among the other distinct rows in the another worksheet.
    Lets say I have values as below in one sheet, I want select/copy only the bold rows to the next sheet.I want first column values to be unique and take any value or first row value of that distinct row.
    Please help. Thanks!!! [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]

    [tr]


    [TD="width: 64"]Col1[/TD]
    [TD="width: 64"]Col2[/TD]
    [TD="width: 64"]Col3[/TD]
    [TD="width: 64"]Col4[/TD]

    [/tr]


    [tr]


    [td]

    Object

    [/td]


    [td]

    Cars

    [/td]


    [td]

    Honda

    [/td]


    [TD="align: right"]2017[/TD]

    [/tr]


    [tr]


    [td]

    Object

    [/td]


    [td]

    Cars

    [/td]


    [td]

    Honda

    [/td]


    [TD="align: right"]2018[/TD]

    [/tr]


    [tr]


    [td]

    Object

    [/td]


    [td]

    Cars

    [/td]


    [td]

    Honda

    [/td]


    [TD="align: right"]2019[/TD]

    [/tr]


    [tr]


    [td]

    Object

    [/td]


    [td]

    Cars

    [/td]


    [td]

    Nissan

    [/td]


    [TD="align: right"]2019[/TD]

    [/tr]


    [tr]


    [td]

    Object

    [/td]


    [td]

    Truck

    [/td]


    [td]

    Ford

    [/td]


    [TD="align: right"]2017[/TD]

    [/tr]


    [tr]


    [td]

    Object

    [/td]


    [td]

    Truck

    [/td]


    [td]

    Chevy

    [/td]


    [TD="align: right"]2018[/TD]

    [/tr]


    [tr]


    [td]

    Object

    [/td]


    [td]

    Truck

    [/td]


    [td]

    Toyota

    [/td]


    [TD="align: right"]2019[/TD]

    [/tr]


    [tr]


    [td]

    Object

    [/td]


    [td]

    Truck

    [/td]


    [td]

    Toyota

    [/td]


    [TD="align: right"]2019[/TD]

    [/tr]


    [tr]


    [td]

    Object

    [/td]


    [td]

    Van

    [/td]


    [td]

    Nissan

    [/td]


    [TD="align: right"]2019[/TD]

    [/tr]


    [tr]


    [td]

    Object

    [/td]


    [td]

    Van

    [/td]


    [td]

    Honda

    [/td]


    [TD="align: right"]2019[/TD]

    [/tr]


    [/TABLE]