+ Reply to Thread
Results 1 to 11 of 11

how to automatically copy a few cells to a a table on another sheet?

  1. #1
    Registered User
    Join Date
    11-04-2013
    Location
    Santos
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    7

    how to automatically copy a few cells to a a table on another sheet?

    Hi all,

    I am new to Macros and VB (by new, I mean I have zero knowledge)

    I hope someone could help me out on this puzzle, well, puzzle for me at least.

    I have been looking around this forum, and saw many similar requests, but I could not figure out how to reuse the codes I found on some of the replies, some would just copy a bunch of rows and so on...

    I make a report every week for some clients, and send via PDF, it's a report about prices.
    I want to start keeping the data on the prices, so I can see via a chart the ups and downs of the prices.

    attached is the Excel file.price repot test.xls

    I only input data on the sheet Price_report_blaser, I want that cells B6, B7, B8, B19, and B27 will be copied to a new line inside the 'Table1' in price_report_statistics

    forgot to mention, on the first column of the table, I would like to add today's date.

    I tried to make a record macro, of course it didn't work :'(

    Could anyone help me please? :D
    Last edited by Wolthers; 11-04-2013 at 08:37 PM. Reason: today's date

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: how to automatically copy a few cells to a a table on another sheet?

    Please Login or Register  to view this content.
    try this code
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: how to automatically copy a few cells to a a table on another sheet?

    Added extra couple of lines to fix your formatting
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-04-2013
    Location
    Santos
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    7

    Re: how to automatically copy a few cells to a a table on another sheet?

    Thanks Humdingaling

    It is copying all the data, including the date, but when I try and copy it again, it shows up on the same line, how can I add it on a new line below?

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: how to automatically copy a few cells to a a table on another sheet?

    I think you have a table. The next row is 16. If you want to copy them in to row 4.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-04-2013
    Location
    Santos
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    7

    Re: how to automatically copy a few cells to a a table on another sheet?

    Thanks AB33, it works really well!!

    If I want to add new cells to the database, the line I should add to the could would be

    .Range("B30").Copy
    ms.Range("F" & NR).PasteSpecial xlValues, Transpose:=True

    right?

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: how to automatically copy a few cells to a a table on another sheet?

    You are copying B30 in to column F, but NR is important. If you use the next empty row on the table
    Please Login or Register  to view this content.
    you get 16, so unless you want to post it to row 16, you have to hard coded it by specifying the next row no.
    If you look at my code, you se NR=4.

  8. #8
    Registered User
    Join Date
    11-04-2013
    Location
    Santos
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    7

    Re: how to automatically copy a few cells to a a table on another sheet?

    it keeps copying to row 4, tomorrow, when I add new data, will it then create a new row using the variable 'NR = 4' plus the 'NR = NR +1' ?

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: how to automatically copy a few cells to a a table on another sheet?

    I found the solution for the next empty row. See attached.

    This finds the next empty row when ever you run the code.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-04-2013
    Location
    Santos
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    7

    Re: how to automatically copy a few cells to a a table on another sheet?

    Thank you very much AB33, it works like a charm :D

    Now the last thing, is it possible not to create new rows for the same day? for instance, I change in the morning, but on the afternoon it's a different price already and I want to only show the last changed price instead of having multiple rows for the same day?

  11. #11
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: how to automatically copy a few cells to a a table on another sheet?

    Please Login or Register  to view this content.
    made a check to AB33 code that will cater for that

+ 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] How to Automatically Copy New Data into the next sheet and have it automatically sorted??
    By ReedDOT in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-24-2013, 10:50 AM
  2. [SOLVED] automatically copy data to other sheet in blank cells
    By 9lg_skr420 in forum Excel General
    Replies: 5
    Last Post: 12-09-2012, 05:50 PM
  3. [SOLVED] Copy cells to a particular table in another sheet
    By imran91 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-12-2012, 09:11 PM
  4. Replies: 1
    Last Post: 09-09-2012, 07:25 PM
  5. [SOLVED] copy cells automatically to next blank cells in another sheet'
    By slohman in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 04-21-2012, 12:29 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