Results 1 to 24 of 24

Thread: Excel VBA

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2009
    Posts
    77

    Excel VBA

    Guys,

    Please help me in developing a small piece of code, Basically i have an excel which i need to run every week. So every time the new data should be updated in a new line but it should not erase the existing one.

    So i need a code to find the end of a row in an excel and start executing set of conditions from the next row.


    Please find the code below:-
    Code:
    objExcel.Visible = True
        Myfile = "D:\Chart\DQ_03-23"
        Set objWB = objExcel.Workbooks.Open(Myfile)
        
        Set objWS = objWB.Worksheets.Add
        objWS.Name = "Chart"
        
        objWS.Cells(2, 1) = DatePart("yyyy", Now)
        objWS.Cells(2, 2) = DatePart("ww", Now)
        ActiveCell.FormulaR1C1 = "=RC[-2]&""_""&""FW""&RC[-1]"
        objWS.Cells(2, 3) = ActiveCell.FormulaR1C1

    Excel o/p is below:

    YEAR FW Yr_FW
    2009 30 2009_FW30
    *** ** ******

    So, next time when i run it should search end of a row and execute the same 3 conditions.
    Would you be able to help me in getting this code.

    Thanks in advance
    Last edited by RobDog888; Jul 20th, 2009 at 04:38 PM. Reason: Added [code] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width