+ Reply to Thread
Results 1 to 2 of 2

VBA for copy data only if current week number changes

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    VBA for copy data only if current week number changes

    Hi, I need help in a vba code that can copy data from one cell to another cell only if current weeknum get change.

    I have data in cell K3:k350, which needs to be copied to cell J3:K350 ONLY if current weeknum gets change.

    Thanks in advance..

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: VBA for copy data only if current week number changes

    You may try something like this.....

    Sub CopyDataBasedOnWeekNum()
    If WorksheetFunction.WeekNum(Date) <> WorksheetFunction.WeekNum(Date - 1) Then
       Range("K3:K350").Copy Range("J3")
    End If
    End Sub
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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] Set PivotTable Filter to Current Day, Current Week, Current Month, or Current Year
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2014, 08:31 AM
  2. UserForm with that shows Previous Week Data and allows you to update current week
    By hicks1ch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2014, 09:47 AM
  3. [SOLVED] Highlight current week number.
    By izy0502 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-07-2014, 09:45 AM
  4. Chart previous week data as grouped and current week as ungrouped
    By r_a_c_a_4_u in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2013, 12:55 PM
  5. getting the current week number formula
    By Kezwick in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-20-2011, 07:42 AM
  6. Replies: 4
    Last Post: 03-21-2011, 05:37 PM
  7. Week Number and current Hour
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2007, 09:37 AM

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