Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Solved: EXCEL VBA: calculate cell position on screen


(!)

Keebellah's Avatar
Keebellah   (Hans) Keebellah is offline Keebellah is a Trusted Advisor with special permissions. Keebellah has a Profile Picture
Computer Specs
Trusted Advisor with 5,350 posts.
THREAD STARTER
 
Join Date: Mar 2008
Location: Oegstgeest, The Netherlands
Experience: Advanced
25-Sep-2009, 10:02 AM #1
Red face Solved: EXCEL VBA: calculate cell position on screen
I can come up with most of the stangest ideas:
I have designed a numer of reports and call these from one lets call it master sheet.
The master sheet has number of objects with associated macro's.
I have forzen the titles in this case in Range("J23")
What I would like to know is how j23 would relate to the active screen resolution.
I found the differente posted codes to calc the screens width and height and based upon that I soom this sheet to the max possible , but do this by trial and error, my screen res is 1280 x 1024 an so I set ActiveWindowzoom = 200 when workbook is activated

Since it's possible that more reports will be added this page will vary so what I want is if the next cell is K36 I would like to know what value this could be in ref to the screenres and then set it to another value, that would then maybe become 175 for my resolution.

I don't know if my explanation / question is clear but .... with all the knowledge in the Forum I'm sure somebody has a solution for me.

Thanks
Attached Thumbnails
Solved: EXCEL VBA: calculate cell position on screen-bso-image.jpg  
Keebellah's Avatar
Keebellah   (Hans) Keebellah is offline Keebellah is a Trusted Advisor with special permissions. Keebellah has a Profile Picture
Computer Specs
Trusted Advisor with 5,350 posts.
THREAD STARTER
 
Join Date: Mar 2008
Location: Oegstgeest, The Netherlands
Experience: Advanced
25-Sep-2009, 05:56 PM #2
I think I found it, am testing.
What I did:
The column width is default 8.43 characters so this is 8.43 x 8 = 67.44 pixels found the poarameters with Google
1 character (X) = 8 pixel (X)
1 character (Y) = 16 pixel (Y)

with a for 1 to 10 (column J=10) I add the columnwidths por these 10 columns * 8 gives me the pixels
screenresolution width vs the pixels gives a zoom value

BTW the same agoes for the rows, The pixel value is 16 for a row so you can calculate the columns 1 - 10 (A - J) and 23 rows down the row heigts and you het an area

hold it against the screen res or for that matter the excel window size you van zoom it to the right size.

If someone has another idea or a simpler way please let me know..

I am even considering to have the needed area to zoom in relation to the Excel window size.

Brain excercise

Last edited by Keebellah; 25-Sep-2009 at 05:59 PM.. Reason: some type'o mistakes and a small addition
Keebellah's Avatar
Keebellah   (Hans) Keebellah is offline Keebellah is a Trusted Advisor with special permissions. Keebellah has a Profile Picture
Computer Specs
Trusted Advisor with 5,350 posts.
THREAD STARTER
 
Join Date: Mar 2008
Location: Oegstgeest, The Netherlands
Experience: Advanced
28-Sep-2009, 12:43 AM #3
I see a lot of people looked at it but I got no feedback.
I think I found something so I'll close this one.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑