Results 1 to 4 of 4

Thread: automatically delete empty rows when transfer data from userform to sheet1
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    May 2019
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default automatically delete empty rows when transfer data from userform to sheet1

    hi, everyone
    i need code automatically delete empty rows when transfer data from userform to sheet1
    i have userform when i fill data it does transfer data to sheet1 i would delete rows from after lastrow contains data without effect the values of others cells the basic of range beginning from a19:e35 in my case when i fill data in range from a19:e22 after this should delete from a23 :e30 don't delete range a33:e35 because linked of value other lastrow contains data in this case rows a22:e22

  2. #2
    Board Regular
    Join Date
    Jan 2015
    Posts
    1,121
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Default Re: automatically delete empty rows when transfer data from userform to sheet1

    This checks what is the last row in column A above row 33, so lr =22 and then delete the range (A23:E32)
    Code:
    Dim lr As Long: lr = Cells(33, "A").End(xlUp).Row  'Last Row
    Range("A" & lr + 1, "E32").Delete
    Last edited by Kamolga; Jun 21st, 2019 at 03:14 PM.

  3. #3
    Board Regular
    Join Date
    May 2019
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: automatically delete empty rows when transfer data from userform to sheet1

    Quote Originally Posted by Kamolga View Post
    This checks what is the last row in column A above row 33, so lr =22 and then delete the range (A23:E32)
    Code:
    Dim lr As Long: lr = Cells(33, "A").End(xlUp).Row  'Last Row
    Range("A" & lr + 1, "E32").Delete
    i fill in data in userform
    the first picture
    the second picture what i want
    https://ibb.co/x36PTcb

    https://ibb.co/Wn2LL7w
    Last edited by abdelfattah; Jun 21st, 2019 at 05:16 PM.

  4. #4
    Board Regular
    Join Date
    Jan 2015
    Posts
    1,121
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Default Re: automatically delete empty rows when transfer data from userform to sheet1

    Code:
    Dim lr As Long: lr = Cells(33, "C").End(xlUp).Row  'Last Row
    Range("A" & lr + 1, "E32").Delete
    Last edited by Kamolga; Jun 25th, 2019 at 07:25 AM.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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