+ Reply to Thread
Results 1 to 3 of 3

how to get the value from cells...

  1. #1
    Registered User
    Join Date
    04-24-2015
    Location
    101
    MS-Off Ver
    2007
    Posts
    50

    how to get the value from cells...

    hi,

    i'm writing a code to compare the to cell values which got dates. but the problem is it not working. can anyone help to solve this problem.

    once i change the value in the cell the change event will fire and goes to other sheet. their it should compare the cell values.

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Address(0, 0) = "F9" Then
    Dim maindate As String
    Dim myRange As Range
    Dim val As String
    Worksheets("Basis and assumptions").Select
    maindate = Range("f9")
    Worksheets("Sheet1").Select
    Set myRange = Range("Q59,Q169")
    For i = 59 To 166
    For j = 1 To myRange.Rows.Count
    If myRange.Cells(i, j).Value = maindate Then
    MsgBox ("found the cell")
    Worksheets("Basis and assumptions").Select
    End If
    Next j
    Next i
    End If
    End Sub

    those cells are from Q59 to Q169. maindate value is from one sheet.. can anyone give an idea please

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: how to get the value from cells...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    04-24-2015
    Location
    101
    MS-Off Ver
    2007
    Posts
    50

    Re: how to get the value from cells...

    thanks a lot

+ 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. Replies: 4
    Last Post: 02-11-2015, 09:02 AM
  2. Replies: 0
    Last Post: 01-21-2015, 12:05 PM
  3. [SOLVED] Linking cells globally to allow users the ability to change cells on separate sheet/cells.
    By V1gilante in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-18-2014, 10:47 PM
  4. combining many cells in one cells keeping character font and hyperlinks of all cells
    By mankind00 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-27-2012, 09:41 AM
  5. Replies: 4
    Last Post: 06-17-2011, 08:53 AM
  6. Formula: Drop Down List -> Choose Option Finds Cells & Replace Cells with Cells
    By g00glethis1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2010, 01:10 PM
  7. Replies: 2
    Last Post: 06-24-2010, 04:53 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