+ Reply to Thread
Results 1 to 2 of 2

Checking empty cells

  1. #1
    Registered User
    Join Date
    06-21-2006
    Posts
    1

    Checking empty cells

    Hello,

    I'm having 4 sheets in a XLS named sheet1,2,3 and total.

    I have 3 emploies and each one will complete an individual sheet, for example emploie john will make a list with all of his clients in sheet1, mark in sheet2,by columns etc.

    I've built a macro that takes the informations from the first 3 sheets and centralize it in the "total" sheet.

    However, the number of clients that each individual emploie has isn`t the same each month. So i want my program to take info from sheet1, put it nicely in total, then automaticaly detect the empty row and take the info from sheet2 and put it right from there, and so on for sheet3.

    If anyone could help me i would be grateful, please note that my experience with VBA is limited and i could use some explicit hints.

    Thanks and sorry for my bad english.

  2. #2
    Norman Jones
    Guest

    Re: Checking empty cells

    Hi Diez,

    Youo can determine the first empty cell in column A of the Total sheet thus:

    Dim destRng As rng

    Set destRng = Sheets("Total").Cells(Rows.Count, "A").End(xlUp)(2)


    Therefore, you could perform the copy operations something like:

    Set destRng = Sheets("Total").Cells(Rows.Count, "A").End(xlUp)(2)
    Sheets("John").Range("A2:D50").Copy Destination:= destRng
    Set destRng = Sheets("Total").Cells(Rows.Count, "A").End(xlUp)(2)
    Sheets("Mark").Range("A2:D100").Copy Destination:= destRng
    Set destRng = Sheets("Total").Cells(Rows.Count, "A").End(xlUp)(2)
    Sheets("Fred").Range("A2:D75").Copy Destination:= destRng



    ---
    Regards,
    Norman


    "Diez" <Diez.29qiw0_1150864203.6639@excelforum-nospam.com> wrote in message
    news:Diez.29qiw0_1150864203.6639@excelforum-nospam.com...
    >
    > Hello,
    >
    > I'm having 4 sheets in a XLS named sheet1,2,3 and total.
    >
    > I have 3 emploies and each one will complete an individual sheet, for
    > example emploie john will make a list with all of his clients in
    > sheet1, mark in sheet2,by columns etc.
    >
    > I've built a macro that takes the informations from the first 3 sheets
    > and centralize it in the "total" sheet.
    >
    > However, the number of clients that each individual emploie has isn`t
    > the same each month. So i want my program to take info from sheet1,
    > put it nicely in total, *then automaticaly detect the empty row* and
    > take the info from sheet2 and put it right from there, and so on for
    > sheet3.
    >
    > If anyone could help me i would be grateful, please note that my
    > experience with VBA is limited and i could use some explicit hints.
    >
    > Thanks and sorry for my bad english.
    >
    >
    > --
    > Diez
    > ------------------------------------------------------------------------
    > Diez's Profile:
    > http://www.excelforum.com/member.php...o&userid=35614
    > View this thread: http://www.excelforum.com/showthread...hreadid=553914
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1