Results 1 to 10 of 10

to HELP! Novice Excel VBAMove Entre Row into another Sheet

Threaded View

  1. #1
    Registered User
    Join Date
    11-12-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2010
    Posts
    4

    to HELP! Novice Excel VBAMove Entre Row into another Sheet

    Hi there,

    I'm new here so I hope I'm posting this correctly.
    I have a little puzzle that I'm really struggling with.

    Scenario
    I have created a spreadsheet that holds my stock portfolio. I have a column in the main portfolio that I record if I have sold the stock.

    What I want to do is move all my sold stocks to a seperate sheet where the value of the cell in that column = "YES"
    I have googled and looked at 15 different examples and they are all so messy.

    Below I created a Macro Recording and have added comments on what I am trying to do.
    The issue is that my code is relevant to checking Range U6 only and determining if that is a "YES"
    I would love it if I could somehow make this search for any row in column U and see which once area marked as "YES" and copy these into the SOLD worksheet.
    The I would want to remove/delete these lines from the main worksheet once they have been copied/moved to the SOLD worksheet.

    Sub Move_Rows()

    ' Check to See which Row in Column U has the word YES in it
    ' If this row has YES then select the entire row to copy

    If Range("U6").Select = "YES" Then

    Rows("6:6").Select
    Selection.Copy

    ' Select Sheet named SOLD
    ' Determin first Empty Cell in Column B


    Sheets("SOLD").Select
    Range("B1000").Select
    Selection.End(xlUp).Select

    ' Special Paste as Values
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False

    ' Select Sheet named Portfolio
    ' Delete Row that was just copied into sheet SOLD
    ' Copy last empty row (as it has formulas) and Paste All by insterting new row


    Sheets("Portfolio").Select
    Application.CutCopyMode = False

    Selection.Delete Shift:=xlUp
    Range("C6").Select
    Selection.End(xlDown).Select

    Rows("13:13").Select
    Selection.Copy
    Selection.Insert Shift:=xlDown


    End If

    End Sub

    Any help would be greatly appreciated, I suspect that this is a walk in the park for some expert VBA coders out there.
    thanks in advance
    Last edited by astraldreamer; 11-12-2013 at 11:30 PM. Reason: typo

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Question from Excel novice
    By Montaigne5 in forum Excel General
    Replies: 6
    Last Post: 03-19-2012, 06:36 AM
  2. VB Novice...Find and Move Cells...
    By jh1201 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-29-2008, 03:01 AM
  3. Replies: 3
    Last Post: 05-19-2006, 06:15 AM
  4. Very Novice Excel user with security question
    By Ralph Malph in forum Excel General
    Replies: 5
    Last Post: 03-23-2006, 02:40 PM
  5. [SOLVED] Excel Novice, Stupid Question, but help!
    By steverob@iname.com in forum Excel General
    Replies: 6
    Last Post: 02-12-2006, 11:15 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