+ Reply to Thread
Results 1 to 8 of 8

help in changing the code that runs on one cell to the whole column

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    23

    help in changing the code that runs on one cell to the whole column

    Hi All,

    I am very to this forum, need a lil help with the following code.

    Please Login or Register  to view this content.
    This code helps me with the following,

    Once i select "closed" from the drop down in the D8 then a macro runs to check if certain cells are blank on the left hand side

    The code work very well,

    The problem is this work only for D8, I want it for D8:D65000.

    Please help :D

  2. #2
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: help in changing the code that runs on one cell to the whole column

    Check if this does what you need:

    Please Login or Register  to view this content.
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  3. #3
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: help in changing the code that runs on one cell to the whole column

    Sorry, change it like this:

    Please Login or Register  to view this content.
    I hadn't realized that the row where you select the value from the dropdown should be the same where you execute the Check macro, but with this change it should work like you wanted. I hope this helps.

  4. #4
    Registered User
    Join Date
    06-06-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: help in changing the code that runs on one cell to the whole column

    Hi But that does not seem to run ... I tried both the methods...

    Could you please explain the terminologies

    Thanks in Advance
    ****Hitesh****

  5. #5
    Registered User
    Join Date
    06-06-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: help in changing the code that runs on one cell to the whole column

    Hi Pichingualas,

    Well the following worked

    [CODE]

    Dim RowCheck As Long
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("D8:D65000")) Is Nothing Then Exit Sub
    If Target = "closed" Then
    RowCheck = Target.Row
    Check
    End If
    End Sub

    Sub Check()
    Dim rngCheck As Range: Set rngCheck = ActiveSheet.Range("A" & RowCheck & ":U" & RowCheck & ",X" & RowCheck & ":AB" & RowCheck)
    Dim iCell As Range
    For Each iCell In rngCheck
    If IsEmpty(iCell) Then
    iCell.Select
    MsgBox ("The selected Cell is empty, Kindly fill it with the appropriate data")
    Exit Sub
    End If
    Next iCell
    End Sub
    [\CODE]

    Thanks a lot for the help

    still need y we write NOT INTERSECT

    Thanks


  6. #6
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: help in changing the code that runs on one cell to the whole column

    Actually if you want to use it like that you should delte the Not.
    The line If Not Intersect(Target, Range("D8:D65000")) Is Nothing Then Exit Sub says that if target is in "D8:D65000" then do nothing.
    Last edited by Pichingualas; 06-06-2012 at 04:23 PM.

  7. #7
    Registered User
    Join Date
    06-06-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: help in changing the code that runs on one cell to the whole column

    But I tried and the files seems to work perfectly :|

  8. #8
    Registered User
    Join Date
    06-06-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: help in changing the code that runs on one cell to the whole column

    Hey Hi,

    I m sorry your idea worked and mine failed...

    The error was :
    If Not Intersect(Target, Range("D8:D65000")) Is Nothing Then

    This was for the column D, but i was trying for column AC :p

    Well it worked...

    now only one concern, I want the cell to be empty wen the Check() Sub is called..

    Please help

+ 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