+ Reply to Thread
Results 1 to 7 of 7

How to save data from one sheet to another sheet using vba

  1. #1
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    454

    How to save data from one sheet to another sheet using vba

    Hello,

    I have data in Sheet "Raw" and I want to copy the data into Sheet "Main" column"B" against matching tickers by shifting columns to right till 300th column
    I want to do this till 300th column and whenever new data is copied after 300 columns the last column should be deleted for inserting the fresh data in Column"B". i.e I want to maintain data for 300 days only

    I am herewith attaching the sample file

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,031

    Re: How to save data from one sheet to another sheet using vba

    Maybe this will work for you.
    Please Login or Register  to view this content.
    BSB

  3. #3
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    454

    Re: How to save data from one sheet to another sheet using vba

    Thank you for the help. When there are no corresponding values the cells values are displayed as #N/A, How to avoid this and make it '''" if there is no corresponding matching data.Also, If new symbol name gets into raw data how to copy new symbol also to Main sheet?

    Once data is saved to main sheet can we avoid duplication of copying the same data again?

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,031

    Re: How to save data from one sheet to another sheet using vba

    Try this
    Please Login or Register  to view this content.
    BSB

  5. #5
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    454

    Re: How to save data from one sheet to another sheet using vba

    I have added few lines to run the query in loop and get the data and copy for various dates, Can it be improved or shortened further?

    I also changed the date cell to B2 in Targetsheet because I kept first row as blank in Targetsheet. Does it require any change in the offset and resize lines of the code ?

    Please Login or Register  to view this content.
    Last edited by zaska; 06-28-2024 at 07:40 AM.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,031

    Re: How to save data from one sheet to another sheet using vba

    Quote Originally Posted by zaska View Post
    I also changed the date cell to B2 in Targetsheet because I kept first row as blank in Targetsheet. Does it require any change in the offset and resize lines of the code ?
    I don't think the offset and resize lines would be affected by that. But it would be easier for you to tell by trying it in your workbook.
    If the workbook is laid out differently to your sample file then it may need tinkering with, but we'd need to see the file to know for sure.
    Always best to have your sample file laid out exactly the same as your real file as it will save a lot of followup work.

    BSB

  7. #7
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    454

    Re: How to save data from one sheet to another sheet using vba

    Yes, you are right the offset and resize lines were not affected. Thank you

+ 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] VBA Filter sheet data to new sheet, save new sheet, email with attachment
    By Shruder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2024, 11:43 AM
  2. adjusted code transfer data from sheet to sheet and save
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-17-2019, 06:11 AM
  3. get data from entry made in invoice sheet and save it to seperate sheet
    By snehaljp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-26-2013, 04:55 PM
  4. Replies: 4
    Last Post: 09-03-2013, 09:56 AM
  5. [SOLVED] Copy Data and paste it in new sheet and save new sheet as value of cell a2
    By VKS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2013, 08:55 AM
  6. Replies: 8
    Last Post: 01-31-2013, 02:55 AM
  7. [SOLVED] VBA Help need for pullout data to new sheet from Master Sheet & save as new file (UserForm
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 01-19-2013, 06:01 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