Results 1 to 2 of 2

Can't assign price/date from another cell to variable

Threaded View

  1. #1
    Registered User
    Join Date
    08-12-2010
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    1

    Can't assign price/date from another cell to variable

    Hi,

    A fairly basic question. I'm getting a 'runtime error 13: type mismatch' when I tried assigning a price or date from another cell to a variable.

    I've tried the following:

    Date1 = ThisWorkbook.Sheets(sCell).Range("A2").Value
    Date1 = Sheets(sCell).Range("A2").Value
    Date1 = Sheets(sCell).Range("A2").Date
    I need to assign the variable while I am running a 'For each [cell] in [range]' loop, so I'll need to assign a new value to the variable for each leg of the loop. I've declared Date1 as a date.

    Hope that that's sufficiently clear, forgive my bad programming grammar, I'm pretty new to the scene. Ideas?

    Thanks,

    vanckzhu

    EDIT: Never mind, I was being an idiot. My problem was not with the variables, it was with the select case code.
    Last edited by vanckzhu; 08-12-2010 at 01:53 PM.

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