+ Reply to Thread
Results 1 to 12 of 12

Private Sub Worksheet Change Help please!

  1. #1
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Private Sub Worksheet Change Help please!

    Hi All,

    I have a problem incorporating a couple of arguments on my Private Sub Worksheet Change, any chance of a hand?

    At the moment it just loops.

    Please Login or Register  to view this content.
    I will eventually want to add in the following arguments too, I am sure this is an easy question, still new to VBA

    If Not Intersect(Target, Target.Worksheet.Range("Q27")) Is Nothing Then awayoddlegone
    If Not Intersect(Target, Target.Worksheet.Range("R27")) Is Nothing Then awayoddlegtwo
    If Not Intersect(Target, Target.Worksheet.Range("S27")) Is Nothing Then awayoddlegthree
    If Not Intersect(Target, Target.Worksheet.Range("T27")) Is Nothing Then awayoddlegfour
    If Not Intersect(Target, Target.Worksheet.Range("U27")) Is Nothing Then awayoddlegfive
    If Not Intersect(Target, Target.Worksheet.Range("V27")) Is Nothing Then awayoddlegsix
    If Not Intersect(Target, Target.Worksheet.Range("W27")) Is Nothing Then awayoddlegseven

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Private Sub Worksheet Change Help please!

    What code do awayoddlegone to awayoddlegseven have?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Private Sub Worksheet Change Help please!

    Hi, Thanks for your response,

    they are variations on this code

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Private Sub Worksheet Change Help please!

    And this is the same code for awayoddlegseven and the others?

  5. #5
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Private Sub Worksheet Change Help please!

    They would be the same, just using different cells,

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Private Sub Worksheet Change Help please!

    Maybe you can try and explain what you are trying to do with the entire code using a sample file?

    We can help you simplify it further if possible.

  7. #7
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Private Sub Worksheet Change Help please!

    Just been trying to strip it back so I can send a file that can show what I am trying to do as my working file is quite large.

    I dont think I can upload something that would help

    Can I skype to you?

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Private Sub Worksheet Change Help please!

    For the benefit of all users, its better you upload the file here.

    Just a sample file with dummy data will do, as long as the format matches the original file.

  9. #9
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Private Sub Worksheet Change Help please!

    All the coding work individually, its just trying to put them together that seems to be the problem

    Please Login or Register  to view this content.
    and,

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Private Sub Worksheet Change Help please!

    Actually,

    Running this code

    Please Login or Register  to view this content.
    Just continues to loop,

  11. #11
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Private Sub Worksheet Change Help please!

    Hi,

    I have uploaded a dummy file,

    Basically,

    once data has been entered into Cell Q27, I want the totals in B28 and Q28 to be copied and pasted into B32 and Q32, then B8:B27 and Q8:Q27 have contents cleared.

    The code I have set up doesnt work as it should and it loops.

    Once this has been done I would need it to be merged with the following code which already works

    Please Login or Register  to view this content.
    Attached Files Attached Files

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Private Sub Worksheet_Change Merge help required.

    Using what little you've provided,

    Please Login or Register  to view this content.
    Your use of Left and Right as procedure names conflicts with the use of the native VBA functions of the same name, which is not a hot idea.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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