+ Reply to Thread
Results 1 to 8 of 8

Macro to separate the data based on Column

  1. #1
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Macro to separate the data based on Column

    Hi Friends

    I have attached the spreadsheet example. The tab "Report" has system generated data which has data for four entities. I want to separate this data based on values in Column A. Sheet1 to Sheet4 is what i want to achieve using macro.

    The macro should look at column A and where it has value 107001, it should copy the data into new worksheet. For any change in value in column A, it should copy the data into new worksheet and so on.

    Is there anyway this can be achieved via macro?

    Really appreciate your help.

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Perth Western Australia
    MS-Off Ver
    Office 365
    Posts
    257

    Re: Macro to separate the data based on Column

    Hi

    A macro will achieve what you need however I did notice that the columns in the report tab do not add to respective subtotals
    ie
    Rental Income

    10302 Retail Rent-Major 100
    10304 Retail Rent-Speciality 100

    Total Rental Income 100 This should be 200 unless my interpretation of the financial report is erroneous.

    If you need the report to relect the revised mathematical equation ( and subsequently each entity tab that can also be rectified.

    Please advise and I will try and solve your requirements.

    Cheers

  3. #3
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Macro to separate the data based on Column

    Hi

    That's fine..I have changed the numbers hence it is incorrect. It should be 200. The system generated report doesn't have formula.

    Thanks for your time and effort.

  4. #4
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Perth Western Australia
    MS-Off Ver
    Office 365
    Posts
    257

    Re: Macro to separate the data based on Column

    Hi

    I have modified a number of cells in colum 1 of your report and highlighted the changed cells in red.

    I also noticed Entity ID 407028 has the entity name Benowa Village and also Village Centre and assumed this was intentional.

    However have managed to create a macro on a new sheet (Control) and all appears to work although somewhat slower than I anticipated. This has taken a simple approach and the macro will have to be modified if new entities are added or deleted.

    To see the macro click developer\macro\Macr1 \edit.

    If this answers your problem great if not please advise.

    Cheers

  5. #5
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Macro to separate the data based on Column

    Hi friends

    I have managed to get macro. However, it repeats the heading from sheet3 onwards. Not sure what's the issue?

    Can anyone please advise why it repeats the heading?

    Thanks for your assistance.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Perth Western Australia
    MS-Off Ver
    Office 365
    Posts
    257

    Re: Macro to separate the data based on Column

    Hi

    Change row
    Set Rng = Sh.Range("A3:A" & Sh.Range("A65536").End(xlUp).Row)

    to

    Set Rng = Sh.Range("A2:A" & Sh.Range("A65536").End(xlUp).Row)

    This seems to work

    Cheers

  7. #7
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Macro to separate the data based on Column

    Hi

    I have done the changes as advised but it still repeats

  8. #8
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Perth Western Australia
    MS-Off Ver
    Office 365
    Posts
    257

    Re: Macro to separate the data based on Column

    Hi

    My mistake I will continue to assist.

    Cheers

+ 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] Macro to combine duplicate Rows Based on a particular Column to separate INV Headings
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-28-2017, 06:38 AM
  2. Macro to separate data based on contents of a column to 2 new excel files
    By beautify5 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-18-2015, 11:19 AM
  3. Require Macro to get data in separate column
    By sriku in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-16-2014, 02:52 PM
  4. [SOLVED] Splitting up data into separate sheets based on a column
    By cloakedgerb in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-23-2014, 12:37 PM
  5. [SOLVED] Pulling Data to separate sheets based on one column
    By joliver in forum Excel General
    Replies: 10
    Last Post: 10-04-2013, 05:14 PM
  6. Replies: 3
    Last Post: 04-11-2012, 11:00 AM
  7. [SOLVED] Separate data into columns based on the value of one column?
    By dziw in forum Excel General
    Replies: 4
    Last Post: 10-11-2007, 01:58 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