+ Reply to Thread
Results 1 to 15 of 15

Removing a line of data in a spreadsheet

Hybrid View

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    Removing a line of data in a spreadsheet

    I have this macro that finds a line of data that is annoted 'complete' and records the row of data in another worksheet called complete.
    It works fine.
    What I would like to do is once the line of data is transferred to the new sheet I would like the original line of data to be removed.
    Can anyone help please
    I tried to add a line to the macro but it didn't work
    Thanks
    Range("C" & Target.Row).Copy Sheets("COMPLETE").Range("B" & foundCase.Row)
                Range("G" & Target.Row).Copy Sheets("COMPLETE").Range("C" & foundCase.Row)
                Range("Z" & Target.Row).Copy Sheets("COMPLETE").Range("D" & foundCase.Row)
                Range("H" & Target.Row & ":U" & Target.Row).Copy Sheets("COMPLETE").Range("E" & foundCase.Row)
                Range("W" & Target.Row).Copy Sheets("COMPLETE").Range("S" & foundCase.Row)
                Range("AA" & Target.Row).Copy Sheets("COMPLETE").Range("T" & foundCase.Row)
                
            Else
                 bottomA = Sheets("COMPLETE").Range("A" & Rows.Count).End(xlUp).Row
                 Range("A" & Target.Row).Copy Sheets("COMPLETE").Range("A" & bottomA + 1)
                  Range("C" & Target.Row).Copy Sheets("COMPLETE").Range("B" & bottomA + 1)
                Range("G" & Target.Row).Copy Sheets("COMPLETE").Range("C" & bottomA + 1)
                Range("Z" & Target.Row).Copy Sheets("COMPLETE").Range("D" & bottomA + 1)
                Range("H" & Target.Row & ":U" & Target.Row).Copy Sheets("COMPLETE").Range("E" & bottomA + 1)
                Range("W" & Target.Row).Copy Sheets("COMPLETE").Range("S" & bottomA + 1)
                Range("AA" & Target.Row).Copy Sheets("COMPLETE").Range("T" & bottomA + 1)
                Range(Target.Row).EntireRow.Delete
            End If
             ElseIf Target = "complete" Then
            bottomC = Sheets("SSAFADivFunds").Range("C" & Rows.Count).End(xlUp).Row
            Set foundCase = Sheets("SSAFADivFunds").Range("C2:C" & bottomC).Find(Target.Offset(0, -17), LookIn:=xlValues, LookAt:=xlWhole)
            If Not foundCase Is Nothing Then
            Range("A" & Target.Row).Copy Sheets("SSAFADivFunds").Range("A" & foundCase.Row)
    Last edited by scrumpyjack; 12-10-2017 at 10:50 AM.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Removing a line of data in a spreadsheet

    Try changing the .Copy to .Cut
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Removing a line of data in a spreadsheet

    Thanks for the quick response
    This is the line of code I entered
    'Range(Target.Row).EntireRow.Delete'
    Without it every thing works as it should. So why change 'copy' to 'cut' ?
    Won't this effect the rest of the program?
    Fred

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Removing a line of data in a spreadsheet

    Cut does the same as copy with one exception....after it pastes, the "cut" information is deleted, with "copy", the original information stays.
    Without a sample of what you are working with, I can't say if it would effect the rest of the program or not.

  5. #5
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Removing a line of data in a spreadsheet

    Thanks that worked. See were you were coming from.

    Right a relly basic excel question the sheet tabs at the bottom of the rotten workbook have disappeared and I can't get them back. Please tell me how

    Thanks

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Removing a line of data in a spreadsheet

    Go to excel options (not sure how to get there with 2003)
    Click Advanced
    Scroll to Display options for this workbook
    Make sure the box for Show sheet tabs is checked
    Last edited by gmr4evr1; 12-10-2017 at 10:24 AM. Reason: Corrected typo

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Removing a line of data in a spreadsheet

    Hi scrumpyjack,

    Please apply code tags to post #1 before we can proceed!
    HTH
    Regards, Jeff

  8. #8
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Removing a line of data in a spreadsheet

    Sorry about the code
    Sorry but the sheet tab was already ticked
    So the sheet tabs still are not showing.
    Fred

  9. #9
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Removing a line of data in a spreadsheet

    Did they disappear after running the code with the .Cut option?

  10. #10
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Removing a line of data in a spreadsheet

    I don't think disappeared as such. Well to be honest I must have done something but it wasn't as a result of implementing the cut bit of code.

  11. #11
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Removing a line of data in a spreadsheet

    Fred,
    Is it possible for you to attach the workbook....desensitized of course?

  12. #12
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Removing a line of data in a spreadsheet

    How do I do that?
    Can I send it just to you?

  13. #13
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Removing a line of data in a spreadsheet

    In the window you are typing in, click the Image Icon (2 to the right of the Link [the one with the globe and chain] icon.
    Click the From Computer tab
    Click Basic Uploader (bottom right)
    Click browse
    Click the file you want to attach
    Click Upload File(s)

  14. #14
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Removing a line of data in a spreadsheet

    The thing is it has personal details of clients etc and this can be seen.
    I can't get into the main spread sheet as I cannot select sheets ie the sheet tabs are missing from the bottom of the page therefore not able to de-sensitised..
    Can I email you the spread sheet?
    Fred

  15. #15
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Removing a line of data in a spreadsheet

    Are you able to see the sheet(s), just not the tab(s)? If so, is it possible the other sheets are hidden or deleted?

+ 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. [SOLVED] UserForm to Spreadsheet - Cannot get data to go to the next empty line.
    By ChristaToTheMax in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2017, 12:39 PM
  2. Removing one spreadsheet of data from another
    By AndyH1 in forum Excel General
    Replies: 5
    Last Post: 11-18-2015, 05:17 AM
  3. [SOLVED] Removing HTML tags from a spreadsheet from data obtained through a database query
    By Excelfail in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-17-2014, 12:35 AM
  4. Replies: 0
    Last Post: 07-29-2014, 11:43 PM
  5. Browse window: Importing data onto a new line in another spreadsheet
    By jennymc in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-18-2013, 05:34 AM
  6. How do I get to the last line of a large spreadsheet to add data
    By LyndaGTT in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-07-2006, 01:25 PM
  7. [SOLVED] Removing data from cell within an excel spreadsheet
    By Dawn in forum Excel General
    Replies: 6
    Last Post: 02-21-2006, 01:20 PM

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