Thread: Cells.Range
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
markorm markorm is offline
external usenet poster
 
Posts: 1
Default Cells.Range

Good afternoon!

I'm pretty new to VBA and have been plumbing my way through, reading
lot of content on here to help me by


I've got a bit of a problem in my sheet when I use the RefEdit object.


I have a main form (frmMain) and I can launch a sub form (frmRefEntry
to go select a cell. I'm using the value of this cell to populate th
text field of my main form (txtRef)

Basically I'm saying that:

frmMain.txtRef.Value = Cells.Range(frmRefEntry.refInput.Value)

Now! This works wonderfully. If I stay on the same worksheet that
launched the form from. The problem comes when I open the sub form an
select a cell from a different worksheet, it messes up giving me an Ap
or Object defined error




I have sort of figured out that it's the fact that it's another shee
that's causing this a problem and am thinking somewhere down the lin
that the Cell.Range property will ignore the sheet name? or uses Sheet
or Sheet2 instead of the actual name? But I'm only guessing.


Anyone have any idea?

any help would be good.


Cheer

--
Message posted from http://www.ExcelForum.com