ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cells.Range (https://www.excelbanter.com/excel-programming/300915-cells-range.html)

markorm

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 :cool:


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 :mad:




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



All times are GMT +1. The time now is 04:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com