+ Reply to Thread
Results 1 to 7 of 7

Macro which counts the number of cells in sheet 1& in sheet 2 this exact number is pasted

  1. #1
    Registered User
    Join Date
    09-08-2015
    Location
    Spain
    MS-Off Ver
    2013
    Posts
    8

    Macro which counts the number of cells in sheet 1& in sheet 2 this exact number is pasted

    Hello,

    I want to create a macro which counts the number of cells in one column (in spreadsheet 1) and then in spreadsheet 2, in columns A 2, B2 and C2 onwards the same count of cells with the exact number of values from the column in worksheet 1 are pasted.

    The value in worksheet 1 would change; there is no defined range. So I would like the macro to find out how many cells have data in a column in sheet1 and then in the sheet2 in three columns to paste the same number of cells. I am not sure how to do this, does anyone have any suggestions?


    Thank you
    Last edited by Soneeka; 09-08-2015 at 01:18 PM.

  2. #2
    Forum Contributor
    Join Date
    05-27-2014
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    2007 & 2010
    Posts
    273

    Re: Macro which counts the number of cells in sheet 1& in sheet 2 this exact number is pa

    Are you asking to have the data in a column on Sheet 1 (no matter how large it is) copied and pasted to three columns in sheet 2 so that each column has the same data and is an exact copy of the column in sheet 1? If this is the case, it's not necessary to workout how many cells have values in them, you can just copy the column and paste it three times (effectively) with VBA. Please clarify.
    Please click *Add Reputation if I've helped

  3. #3
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Macro which counts the number of cells in sheet 1& in sheet 2 this exact number is pa

    Like so?

    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  4. #4
    Registered User
    Join Date
    09-08-2015
    Location
    Spain
    MS-Off Ver
    2013
    Posts
    8

    Re: Macro which counts the number of cells in sheet 1& in sheet 2 this exact number is pa

    I don't want to copy the cells in the column in sheet 1, I want to find out the count of this and then in sheet 2 to have the same number of cells to be copied in a column
    Last edited by Soneeka; 09-08-2015 at 11:39 AM.

  5. #5
    Registered User
    Join Date
    09-08-2015
    Location
    Spain
    MS-Off Ver
    2013
    Posts
    8

    Re: Macro which counts the number of cells in sheet 1& in sheet 2 this exact number is pa

    Thank you, i will try this code

  6. #6
    Forum Contributor
    Join Date
    05-27-2014
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    2007 & 2010
    Posts
    273

    Re: Macro which counts the number of cells in sheet 1& in sheet 2 this exact number is pa

    Quote Originally Posted by Soneeka View Post
    I don't want to copy the cells in the column in sheet 1, I want to find out the count of this and then in sheet 2 to have the same number of cells to be copied in a column
    It's still not really clear what you want.

    This will count the number of used cells in column A on sheet 1 and then copy the same number of consecutive cells from columns A:C on sheet 2. Then they'd need to be pasted somewhere.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-08-2015
    Location
    Spain
    MS-Off Ver
    2013
    Posts
    8

    Re: Macro which counts the number of cells in sheet 1& in sheet 2 this exact number is pa

    Thank you....I am finding this difficult to explain, sorry.

    I want to create a macro which counts the number of cells in sheet1 column D and then for sheet 2 i want the exact number of cells found in sheet 1 column D to be pasted in columns D, E and F.

    In the second sheet there is a macro which formulates the values in sheet 1 Column D, this is why i don't need to copy these values.

    In sheet 2 in order to show these values, it has to be the same number in sheet 1 Column D , so i don't want to manually copy and paste, i would like a macro to find the number of values in sheet 1 column d and then in sheet 2 columns, d, e and f to have the same number of cells to be pasted.
    Last edited by Soneeka; 09-08-2015 at 03:46 PM.

+ 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] User inputs number on sheet 1 and multiple cells (from sheet 2) are shown on sheet 3
    By rimshot609 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-31-2014, 12:54 AM
  2. Color a certain number of cells based on a number from a separate sheet.
    By keeblerelf in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-19-2013, 06:11 AM
  3. Replies: 4
    Last Post: 11-28-2012, 01:43 PM
  4. Count the number of duplicates in a sheet, report the duplicate cells to a new sheet.
    By SamPetroda in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2012, 09:48 AM
  5. [SOLVED] Excel VBA/Macro - Copy Number of Rows based on the number in a cell to another sheet
    By diane.alexander58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2012, 11:32 AM
  6. [SOLVED] search for string in another sheet, get cell number and put cells in first sheet
    By 2k05gt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-08-2011, 01:34 PM
  7. Macro to move cells (Col B to Col V) to other sheet. Place line number in col A
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-29-2011, 03:43 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