+ Reply to Thread
Results 1 to 4 of 4

macro for crating a new sheet by comparing date

  1. #1
    Registered User
    Join Date
    10-04-2015
    Location
    calicut
    MS-Off Ver
    office365
    Posts
    14

    macro for crating a new sheet by comparing date

    HI,

    I have an excel sheet which contains date in A1 cell and one data in A2 cell.
    These two data are changing every day

    My purpose is: when a macro run,

    *open a new work sheet

    just paste the date in A1 cell of new work sheet and data to A2 cell
    please help to create a macro.i am a begener

    shanu

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: macro for crating a new sheet by comparing date

    Here is one version:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-04-2015
    Location
    calicut
    MS-Off Ver
    office365
    Posts
    14

    Re: macro for crating a new sheet by comparing date

    HI,

    Thanks for your help.I have updated this code as given under

    Sub SendToNewSheet()
    Dim sh As Worksheet, ws As Worksheet
    Set sh = ActiveSheet
    Set ws = ThisWorkbook.Sheets.Add(After:= _
    ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
    ws.Range("A1").Value = sh.Range("A1").Value
    ws.Range("A2").Value = sh.Range("A2").Value
    End Sub


    Here it is working,but my requirement is the values of cells A1 &A2 will be change every day(Set sh = ActiveSheet).In this code,sheets are creating every day and paste the value.But my requirment is paste the values from active sheet to the new created sheet like in DAY1:A1,A2 DAY2:B1,B2 DAY3:C1,C2.Is it possible

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: macro for crating a new sheet by comparing date

    You can copy and change the code to whatever you require.

+ 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] Copy selection by comparing date in one sheet with date in another sheet
    By SMasher in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-26-2014, 08:18 AM
  2. [SOLVED] Crating a formula when a value is exceeded
    By Nick1966 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 01-15-2014, 06:50 AM
  3. Need Macro to pull data from one excel sheet to another based on a job# and comparing date
    By electromattnic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-10-2013, 04:10 AM
  4. Crating pivot tables using Loops
    By booo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2010, 06:47 PM
  5. help in crating a macro
    By shishirnaik55 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2009, 03:21 AM
  6. Finding external Excel files and crating a dashboard.
    By trumb1mj in forum Excel General
    Replies: 1
    Last Post: 05-26-2006, 02:35 PM
  7. [SOLVED] Help crating a formula with various arguments
    By GretPR in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-18-2005, 07:06 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