Results 1 to 9 of 9

Thread: Need help to modify the VBA code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Oct 2014
    Posts
    26
    Rep Power
    0

    Need help to modify the VBA code

    Hello All,

    I'm working on a tracker that splits data from multiple rows into several new worksheets. I'm done with that part already and the challenge I have now is how to send the newly created worksheet via email. Please see the attached file for your reference.

    Thanks in advance for any assistance that will be provided.

    Code:
    Sub SplitData()
    
    Dim WorkRng As Range
    Dim xRow As Range
    Dim SplitRow As Integer
    Dim xWs As Worksheet
    On Error Resume Next
    xTitleId = "Backlog Tracker"
    Set WorkRng = Application.Selection
    Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
    SplitRow = Application.InputBox("Split Row Num", xTitleId, 5, Type:=1)
    Set xWs = WorkRng.Parent
    Set xRow = WorkRng.Rows(1)
    Application.ScreenUpdating = False
    For i = 1 To WorkRng.Rows.Count Step SplitRow
    resizeCount = SplitRow
    If (WorkRng.Rows.Count - xRow.Row + 9) < SplitRow Then resizeCount = WorkRng.Rows.Count - xRow.Row + 1
    xRow.Resize(resizeCount).Copy
    Application.Worksheets.Add after:=Application.Worksheets(Application.Worksheets.Count)
    Application.ActiveSheet.Range("A1").PasteSpecial
    Set xRow = xRow.Offset(SplitRow)
    Next
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
    End Sub


    Backlog_Report_Generator_ver4.xlsm
    Last edited by Admin; 10-20-2014 at 01:23 PM.

Similar Threads

  1. Try to modify printer defaults from access-vba
    By relui in forum Access Help
    Replies: 0
    Last Post: 10-24-2013, 02:56 PM
  2. Replies: 1
    Last Post: 08-23-2013, 06:33 PM
  3. Replies: 15
    Last Post: 08-23-2013, 12:03 PM
  4. Shorten VBA Code By Removing Redundant Superfluous Code
    By paul_pearson in forum Excel Help
    Replies: 2
    Last Post: 08-15-2013, 09:09 PM
  5. Council to modify code
    By PcMax in forum Excel Help
    Replies: 4
    Last Post: 02-05-2012, 11:03 PM

Tags for this Thread

Posting Permissions

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