1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: EXCEL VBA: calculate cell position on screen

Discussion in 'Business Applications' started by Keebellah, Sep 25, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. Keebellah

    Keebellah Trusted Advisor Thread Starter

    Joined:
    Mar 27, 2008
    Messages:
    5,946
    :eek: 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 Files:

  2. Keebellah

    Keebellah Trusted Advisor Thread Starter

    Joined:
    Mar 27, 2008
    Messages:
    5,946
    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
     
  3. Keebellah

    Keebellah Trusted Advisor Thread Starter

    Joined:
    Mar 27, 2008
    Messages:
    5,946
    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
As Seen On...

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.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/863698