Next empty column and next empty row

  • Hallo folks
    I have started an application in Excel.
    Column 1 or A contains codes of people names.
    I want the vba code to find the next empty column (which will be B).
    I want to place data in B until i have reached the length
    of FILLED column A (Find the next empty row in column B)


    Only then I want the code to find the next empty column.
    The code to find the next empty column is as follows and works just fine:


    Dim NextEmptyCol As Long
    NextEmptyCol = Cells.Find("*", [A1], , , xlByColumns, xlPrevious).Column + 1



    MsgBox "Column Number" & " " & NextEmptyCol & vbCr & _
    "Or column letter """ & Replace(Cells(1, NextEmptyCol).Address(0, 0), 1, "") & """", vbInformation, "The next empty Column is ..."



    [TABLE="width: 500, align: center"]

    [tr]


    [td]

    A

    [/td]


    [td]

    B

    [/td]


    [td]

    C

    [/td]


    [td]

    D

    [/td]


    [td]

    E

    [/td]


    [/tr]


    [tr]


    [td]

    Teachers

    [/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [td]

    AC

    [/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [td]

    PT

    [/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [td]

    JC

    [/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [td]

    WT

    [/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [/TABLE]
    I need assistance filling column B with data until the length of filled
    column A had been reached. I can use all assistance I can get.


    Thanks folks.

    crow

  • Re: Next empty column and next empty row


    Hello crow,
    You can navigate the cell like...

  • [ATTACH=JSON]{"alt":"Click image for larger version Name:\texcel datafile snap.JPG Views:\t3 Size:\t39.9 KB ID:\t1208940","data-align":"none","data-attachmentid":"1208940","data-size":"full"}[/ATTACH]


    I have three workbook. Workbook-1 Master Data File (Picture above). Workbook-2 FORM-1 and Workbook-3 FORM-2.
    Data FORM 1 and 2 send data to Master Data File using following code. When FORM-1 send data to Master Data file its occupied cell A2 to AD2 when data from FORM-2 arrived its insert one row down that is in AE3 instead of AE2, I wants data to be inserted next available column columns which is AE2. How to achieve that within below code . Also I want to close Master Data File automatically when Data FORM closed.
    Thanks Shaun


    Following code using in Data FORM-2 also same code use in Data FORM-1.