+ Reply to Thread
Results 1 to 10 of 10

Copy rows from a master sheet to new sheets based on column values, but losing cell size

  1. #1
    Registered User
    Join Date
    05-26-2015
    Location
    Pasco, WA
    MS-Off Ver
    Office 2010
    Posts
    6

    Copy rows from a master sheet to new sheets based on column values, but losing cell size

    Hello,
    I am using VBA to copy rows from a master worksheet to other worksheets based on a column value/name. I am unable to keep the source column and row width though. Below is an example of one of the 30 modules.

    Sub Move_FLJAC()

    Dim i As Range
    For Each i In Range("B1:B2000")
    If i.Value = "FLJAC" Then
    i.Select
    ActiveCell.Rows("1:1").EntireRow.Select
    Selection.Copy
    Sheets("FLJAC").Range("A65000").End(xlUp).Offset(1, 0).PasteSpecial
    End If
    Next i
    End Sub

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy rows from a master sheet to new sheets based on column values, but losing cell si

    Try this:

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Copy rows from a master sheet to new sheets based on column values, but losing cell si

    Please add code tags to your code
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  4. #4
    Registered User
    Join Date
    05-26-2015
    Location
    Pasco, WA
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Copy rows from a master sheet to new sheets based on column values, but losing cell si

    This resulted in the same, non-original, format. What is meant by adding code tags?

  5. #5
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Copy rows from a master sheet to new sheets based on column values, but losing cell si

    you can ask Moderators about this or else read the Forum rules u can come to know

  6. #6
    Registered User
    Join Date
    05-26-2015
    Location
    Pasco, WA
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Copy rows from a master sheet to new sheets based on column values, but losing cell si

    Sub Move_FLJAC()

    Dim i As Range
    For Each i In Range("B1:B2000")
    If i.Value = "FLJAC" Then
    i.Select
    ActiveCell.Rows("1:1").EntireRow.Select
    Selection.Copy
    Sheets("FLJAC").Range("A65000").End(xlUp).Offset(1, 0).PasteSpecial
    End If
    Next i
    End Sub

  7. #7
    Registered User
    Join Date
    05-26-2015
    Location
    Pasco, WA
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Copy rows from a master sheet to new sheets based on column values, but losing cell si

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy rows from a master sheet to new sheets based on column values, but losing cell si

    Submit your workbook, or an example workbook, which clearshows a before and after.

  9. #9
    Registered User
    Join Date
    05-26-2015
    Location
    Pasco, WA
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Copy rows from a master sheet to new sheets based on column values, but losing cell si

    Copy attached. I limited the date to two locations in column B and all modules are loaded.
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Copy rows from a master sheet to new sheets based on column values, but losing cell si

    Hi Fleming

    please find the attached file

    just open the workbook press Alt+F8 and select Naveed_Final_Macro & Click on Run it

    you can find the code in Module (Module name is Naveed_Final), hence please have test and confirm

+ 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. How to create and populate sheets based upon cell values in master sheet?
    By mezzopiano1423 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2013, 12:51 PM
  2. [SOLVED] Add Data in Different Sheets and Result in Master Sheet based on Cell Values
    By dksodhi in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-18-2013, 01:08 PM
  3. Copy rows from master sheet to other sheets based on criteria
    By spikeysas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2011, 04:28 AM
  4. Copy rows from master sheet to other sheets if certain cell in column is blank
    By nadiaraciti in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-29-2011, 02:05 AM
  5. Copy Rows from Master Sheet to Child Sheets Base on Values
    By Traquair in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2010, 03:19 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