+ Reply to Thread
Results 1 to 2 of 2

If Statement Based on Cell Data

  1. #1
    Registered User
    Join Date
    11-18-2009
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    29

    If Statement Based on Cell Data

    I am mapping data from an Excel spreadsheet into a fillable PDF. The last issue I'm running into is that I have 2 checkboxes in the PDF, FirstDraw and SecondDraw. In Column I of my Excel document, there is either a 1 or a 2 entered. How can I write an If statement to say if column I = 1 then check the box else move on. I would then do the same thing for the second checkbox. I know I can use a SendKeys " " to check the box but I'm not sure how it knows if it's a 1 or 2 in the cell.

    Thank you.

  2. #2
    Registered User
    Join Date
    10-03-2012
    Location
    Springfield, IL
    MS-Off Ver
    Office 2003-2010
    Posts
    4

    Re: If Statement Based on Cell Data

    Just off the top of my head you would do something like this:

    If Sheets(datasheetname).Cells(row,9).value = 1 then
    ' do check box code (I assume you know how to do that)
    Else
    ' do whatever you need to do for unchecked box
    End If

    Be sure to use the correct name for the data source worksheet and the correct row number in the Cells method reference.

+ 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: 12-20-2016, 09:46 PM
  2. [SOLVED] IF Statement needed to change cell value based on input of another cell
    By kschmit1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-20-2016, 11:41 AM
  3. IF statement on a value based Cell
    By dgreens5 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-24-2016, 06:24 AM
  4. Replies: 2
    Last Post: 07-27-2014, 11:48 PM
  5. [SOLVED] Format Data based on an IF STATEMENT on how many empty spaces in a cell
    By bkeat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2013, 10:57 AM
  6. Cell Captures Data Based on If Statement But Cannot Be Used Further
    By Jrub in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-10-2012, 10:45 AM
  7. If statement based on cell data, if falls in range.
    By finch82 in forum Excel General
    Replies: 3
    Last Post: 10-27-2011, 04:11 PM

Tags for this Thread

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