+ Reply to Thread
Results 1 to 4 of 4

Remove listbox selection (clear) from worksheet and shift / copy remaining data below up

  1. #1
    Registered User
    Join Date
    10-21-2019
    Location
    Shropshire, England
    MS-Off Ver
    2010
    Posts
    2

    Remove listbox selection (clear) from worksheet and shift / copy remaining data below up

    Hi,
    I hope you can help me, apologies if the post is not clear I am relatively new to VBA and to the forum.
    I am struggling with a userform and workbook I am setting up for employee leave organisation. I am trying to create a method for a user to select a leave request from a listbox (linked to worksheet) and cancel it. I would like for the to be able to cancel / remove a record without leaving gaps in either the listbox or the worksheet.
    I have tried a number of methods none of which are helping. when I tried to delete row and shift up it has the desired affect in deleting the row however returns #ref in cells on the worksheet that I don't intend on adjusting as they contain formula, as well as removing the bottom row.
    I then have tried the following to see if I could select a range based on the listbox selection ( the range below the selection up to lastrow) then copy paste values to the same listindex row.


    Please Login or Register  to view this content.
    The range will actually be for more than just the one column ultimately ( I am taking the column approach so as to avoid the columns containing formula - I appreciate there is likely a simpler way of going about this however).

    I suspect that the area where I am having the problem is this :

    Please Login or Register  to view this content.
    if you are able to point me in the right direction either through correcting this or a more straight forwards method it would be hugely appreciated.

    Many Thanks in advance.

    Owen

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,077

    Re: Remove listbox selection (clear) from worksheet and shift / copy remaining data below

    Hello owengriffith,

    Welcome to the forum.

    Members would be much more inclined to assist with your issue if you could upload a sample Workbook.

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    10-21-2019
    Location
    Shropshire, England
    MS-Off Ver
    2010
    Posts
    2

    Re: Remove listbox selection (clear) from worksheet and shift / copy remaining data below

    I think this should be attached now

    Many Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    2,544

    Re: Remove listbox selection (clear) from worksheet and shift / copy remaining data below

    Hi.
    First observations.
    Will each person have their own individual record (is that to be individual sheets or one sheet set up as 'say' as annual register)
    The application has the first appearance as a flat sheet database if this is the case separate the record from the form.
    Use the form as the interface (i.e. reading/writing/deleting record from the database sheet, keep the database sheet free from formula and merge cells.)
    A little time spent now will save a lot of frustration as your app is developed.
    It may sound like pessimism, however its good advice from experience that has been gained at the cost of many bad experiences.
    torachan.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Get Multi Selection Listbox userform and clear all selection
    By jp16 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2018, 10:43 AM
  2. [SOLVED] Delete all cells in each row except the last used cell then shift left all remaining data
    By dave033 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2014, 09:33 AM
  3. Macro to clear row data then shift remaining data up to empty rows.
    By clarmech in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2014, 04:35 PM
  4. Trying to copy a cell range to a different worksheet based on the selection from a ListBox
    By WarrenSmiley in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-10-2013, 03:02 PM
  5. Macro to Remove Cells = 0 and Shift Remaining Cells on Row Left w/ One Condition
    By Mark V. in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-07-2013, 12:45 PM
  6. [SOLVED] Copy And Paste Row Into New Worksheet Based On User Listbox Selection
    By Wings249 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-04-2012, 06:58 AM
  7. Fast way to clear Listbox selection
    By jrushing@ea.com in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2005, 06:05 PM

Tags for this Thread

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