Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Nisha Gor   on Aug 28 In MS Office Category.

  
Question Answered By: Sairah Hashmi   on Aug 28

I am a real rookie in this arena and not sure how to record what
I want to do. However, after a lot of reading, I THINK I am a little closer,
but not sure. Below is the code. When I execute the code, I get the error
message Run-time error '13' -- Type-mismatch on line 4 below (Set myRange =
....).

Dim myWB As Excel.Workbook
Set myWB = GetObject("E:\AORP Project\PPA_200610.xls")
Dim myRange As Range
Set myRange = myWB.Sheets("October 06").Range("C5:C62")
txtTot = myWB.Application.WorksheetFunction.VLookup("Iowa", Range(myRange),
5, False)
Set myWB = Nothing

The State Names are in C5:62 (which I believe is the Range) and I want to get
the value in column  5 of the row  I found the State in.

Do you have any idea where I am going wrong?

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Searching Excel from Word Or get search suggestion and latest updates.


Tagged: