Results 1 to 2 of 2

VBA search another sheet by value from the same row as cursor

Threaded View

unrelatedTheory VBA search another sheet by... 12-24-2013, 03:16 AM
unrelatedTheory Re: VBA search another sheet... 01-03-2014, 11:56 AM
  1. #1
    Registered User
    Join Date
    12-14-2013
    Location
    E-stonia
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    2

    VBA search another sheet by value from the same row as cursor

    Dear enthusiasts,

    Goal: easy one click solution for marking up pivot table for completed tasks and archiving the date of markups.

    Description: Trying to create a VBA coded workbook for task management that would enable later tracking of completion dates.

    Specs: Sheet1 contains information for tasks to be completed starting with taskId which is unique for every row, other information can be the same or and vary row by row. On Sheet2 the information is displayed in a pivot table by tasks with some additional information, summed up by dates. So if you'd have exact same information on two rows it would sum up in the pivot table.

    Progress: I found a piece of code on the internet that helps to mark up the pivot table when clicking on a cell that contains a number bigger than 0, and it also unmarks it if its already marked previously. I know this is not an ideal solution, but it is a start and i would ask help with the search command for VBA. Please see code below.

    sheet1.png

    sheet2.png

    Marking up in progress:
    sheet2_a.png

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
        If Not Intersect(Target, Me.Range("D:Z")) Is Nothing Then
            Cancel = True
            Application.EnableEvents = False
            If Target.Interior.Pattern = xlNone And Target.Value > 0 Then
                Target.Interior.ColorIndex = 6  'yellow
                
                    'by value in Sheet2 column C (Task ID)
                    'search Sheet1
                    'enter timestamp to according cell in on Sheet1 column F
                
                     Else
                Target.Interior.Pattern = xlNone
            End If
        End If
    FallThrough:
        Application.EnableEvents = True
    
    End Sub

    Looking forwards to hearing from you,
    UT
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] cursor moves to right when i protect sheet
    By mrl in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-22-2013, 10:19 AM
  2. Search and move cursor position
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2008, 09:10 AM
  3. [SOLVED] cursor movement within a sheet
    By Janet Panighetti in forum Excel General
    Replies: 5
    Last Post: 06-12-2006, 12:35 PM
  4. [SOLVED] TAB key takes cursor to other end of sheet...
    By Nat in forum Excel General
    Replies: 2
    Last Post: 04-10-2006, 03:10 PM
  5. [SOLVED] My entire sheet moves instead of the cursor. What to do?
    By Trying in forum Excel General
    Replies: 2
    Last Post: 02-20-2005, 02: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