Results 1 to 18 of 18

paste the data of what the quantity is. I Wish anybody here can help me please :(

Threaded View

  1. #16
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: paste the data of what the quantity is. I Wish anybody here can help me please :(

    Hi,

    PFA Execl Sheet attached.. I'v considered Column B to be the 1st one always..

    Sub jasond1992Changed() 'http://www.excelforum.com/excel-programming-vba-macros/1115257-paste-the-data-of-what-the-quantity-is-i-wish-anybody-here-can-help-me-please.html
        
        Application.ScreenUpdating = False
        
        Dim WS As Worksheet, LR As Integer, Counter As Integer, NewWS As Worksheet, LR2 As Integer, CopyCount As Integer, LC As Byte, SHName As String, FC As Integer
        
        Set WS = ActiveSheet
        
        If WS.Range("B1") = "" Then FC = WS.Range("B1").End(xlDown).Row Else FC = 1
        
        SHName = WS.Name
        Set NewWS = Sheets.Add
        
        WS.Activate
        WS.Range(Cells(FC, 2), Cells(FC, 7)).Copy NewWS.Cells(FC, 2)
        NewWS.Activate
        
        LR = WS.Cells(Rows.Count, 2).End(xlUp).Row
        LC = WS.Cells(FC, Columns.Count).End(xlToLeft).Column
        
        For Counter = FC + 1 To LR
            LR2 = NewWS.Cells(Rows.Count, 2).End(xlUp).Row + 1
            CopyCount = WS.Cells(Counter, LC).Value
            WS.Select
            WS.Range(Cells(Counter, 2), Cells(Counter, LC)).Copy NewWS.Cells(LR2, 2)
            NewWS.Select
            NewWS.Range(Cells(LR2, 2), Cells(LR2 + CopyCount, LC)).FillDown
        Next Counter
        
        Cells(FC + 1, 2).Value = 1
        Cells(FC + 2, 2).Value = 2
        Range("B" & FC + 1 & ":B" & FC + 2).AutoFill Destination:=Range("B" & FC + 1 & ":B" & Cells(Rows.Count, 2).End(xlUp).Row)
        
        Range("G" & FC + 1 & ":G" & Cells(Rows.Count, 2).End(xlUp).Row).Value = 1
        
        Application.DisplayAlerts = False
        NewWS.Cells.EntireColumn.AutoFit
        ActiveSheet.Shapes.AddShape(msoShapeRectangle, 392.25, 118.5, 60, 27.75).Select
        Selection.ShapeRange.TextFrame2.VerticalAnchor = msoAnchorMiddle
        Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = "RUN"
        Selection.OnAction = "jasond1992Changed"
        Range("A1").Select
        Sheets(SHName).Delete
        NewWS.Name = SHName
        Application.DisplayAlerts = True
        Application.ScreenUpdating = True
        
    End Sub
    Please excuse my poor coding for this instance..
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Running total of Quantity on Hand Vs Sales Vs Quantity to Produce
    By jespo1351 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-01-2015, 07:34 AM
  2. Replies: 4
    Last Post: 01-14-2015, 07:46 AM
  3. Transferring data from one tab to another when quantity entered
    By Cuffy70 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2013, 06:15 PM
  4. Replies: 3
    Last Post: 05-02-2011, 02:44 PM
  5. Divide monthly Quantity into Weekly quantity ...
    By jitendra.mistry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2010, 01:36 PM
  6. Replies: 5
    Last Post: 11-23-2009, 06:24 PM
  7. Average that change with quantity of data
    By feejo in forum Excel General
    Replies: 5
    Last Post: 08-01-2007, 06:10 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