+ Reply to Thread
Results 1 to 7 of 7

why when copy data from user form don't change by using worksheet change event ?

  1. #1
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    why when copy data from user form don't change by using worksheet change event ?

    Hi experts ,
    I have two codes
    first
    Please Login or Register  to view this content.
    second
    Please Login or Register  to view this content.
    when Press commandbutton1 will copy data to sheet2 without add date in column A and add formula in column H based on first code.
    I'm not sure why don't show in sheet!! , despite of I using this way with another code and works without any problem .
    is it problem from second code?
    I don't attach file because I have sensitive data , if anybody is capable to solve it without attached file I truly appreciated , otherwise I will attach file with random data .
    thanks

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: why when copy data from user form don't change by using worksheet change event ?


    Hi,

    as this is so obvious just reading the condition within the first event codeline !

    [Spoiler ►] What is obviously the Target.Count value ?‼ [◄ Spoiler]

  3. #3
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: why when copy data from user form don't change by using worksheet change event ?

    which line ?

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: why when copy data from user form don't change by using worksheet change event ?

    "ws.Range("B" & LstRw + 1).Resize(UBound(va, 1), UBound(va, 2)) = va"
    va = 7 cols x 11 rows = 77, therefore, the target.count = 77. So:

    If Intersect(Target, [B:B]) Is Nothing Or Target.Count > 1 Then Exit Sub
    Ben Van Johnson

  5. #5
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: why when copy data from user form don't change by using worksheet change event ?

    @protonLeah
    so I should get rid of this Target.Count > 1?
    if it's so will pops application defined error in this line

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: why when copy data from user form don't change by using worksheet change event ?

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: why when copy data from user form don't change by using worksheet change event ?

    @protonLeah
    thanks for correction !
    but based on worksheet change event should just populate in column A,H based on filled for adjacent cell in column B . as you see the picture will populate date until eleventh row without any filling in adjacent cell in column B , should not do that .
    Attached Images Attached Images

+ 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] change event help on a worksheet based on an activex drop down change in another sheet?
    By lilsnoop in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-05-2023, 12:13 AM
  2. [SOLVED] vba excel - worksheet change copy event and target different sheet
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2017, 06:52 PM
  3. [SOLVED] Worksheet change event copy column error
    By ricklou in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2017, 06:59 AM
  4. [SOLVED] How to prevent worksheet change invoking System X Control change event
    By dmw2014 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-13-2014, 10:35 PM
  5. [SOLVED] Change event problem when the user switches worksheet without pressing ENTER
    By franklyn in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-05-2012, 08:12 PM
  6. change event macro to evaluate windows user who initiated the change then send email
    By pmanoloff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2012, 03:31 PM
  7. Filling form fields via worksheet dropdowns, user update via form, change form color
    By Demosthenes&Locke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2010, 08:58 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