
Find Pixel Coordinates Of A Cell


Search Excel Forum Posts, Tutorials, Macros, Tips, and More
Anyone know of a way to get the pixel coordinate (say TOP) for a particular row. Currently, i use ActiveSheet.ChartObjects("chart 11").Top = 305 to move my chart to coordinate 305. However, when another user has a different screen resolution that's not the position I want. I need the pixel coordinate of Row 24. Anyone?
Thanks a million.
Similar Excel Video Tutorials
Amazing Find & Go To Trick!
 See how to use the Find command to go to all cells with a certain formatting, or even a certain function! Then it is easy to make universal changes af ...
Helpful Excel Macros
Get Values from a Chart
 This macro will pull the values from a chart in excel and list those values on another spreadsheet. This will get the s
Similar Topics
I'm trying to return values of xy coordinates off of a particular data point from a series in a chart . My goal is to add a single line, based on a xy coordinate (pixel coordinate is what I believe I need) to a large number of charts. My difficulty lies in obtaining the xy coordinates, rather I believe all I really need is the x coordinate. I've been trying to use the ValueToPoint() function, but I can't seem to get it to work. The MSDN forum doesn't provide too much information, rather I can't find the file they're referencing in their example, so I can't trace to see how the code is supposedly to actually work. (The link to their help section is he http://msdn2.microsoft.com/enus/lib...ffice.10).aspx). The other code is not a problem of compiling, but I'm just missing the coordinate to reference where to start drawing. Any help would be greatly appreciated. Thanks.
Hi
Is there a way to capture the data from a DOS like screen (3rd party
software) without connecting to the database. May be using the coordinate
system / copying data to clip board and searching for specific string ect.?
The screen size and pixel / resolution will be consistent for all users.
The data will always be dispayed on a specific coordinate on the screen all
the time. The filed lengths are fixed as well.
Any help is appreciated.
Thanks
Mohan
Hi
I have never set column width before, If posibel could someone show me how to do it.
I have a sheet which i would like to set
Rows 5 and downward to height=30:00(40 pixels).
Column at diffrent width.
Column A = 4.43 (36 pixel)
Column B = 6.00 (47 pixel)
Column C = 16.71 (122 pixel)
Column D = 24.57 (177 pixel)
Column E = 15.86 (116 pixel)
Column F = 18.86 (137 pixel)
Not sure how to do this, have looked at lots of answers but more confused now.
If someone can assist.
Regards
I have a XYscatter(with lines) chart where I even want to show the coordinates for each point in the chart. I manage to show either the xcoordinate or the ycoordinate but not both at the same time.
Hope someone can help me!!
I have two paired sets of XY (Cartesian coordinate) data. I need to correlate coordinate set Xa n Ya n with coordinate set Xb n Yb n from 1 to N. Formulaaaa suggestions or references?
Thanks
I have sets of data on a scatter plot chart with log log scales. I would like to find the (x,y) coordinate where the slope m =1, m=0.25, etc.
Is there some sort of goal seek that scans through the chart to find these (x,y) coordinates after I input the target slope?
Thanks.
I am wondering if there is a way of getting the x and y coordinates (in relation to x and y data) from wherever the mouse is clicked on a chart. I am not meaning x and y screen pixel coordinates, i need x, y coordinates for chart data.
For example lets say you have dollars on y axis, and product on x. If you click the mouse on the chart it would spit out the product number and dollars (from x and y coordinates on the chart) for the position of the mouse pointer.
Thanks,
Chris
Say I have a list of XY coordinates, each in their own column. What I need to do is somehow mark each coordinate as falling into one of 3 categories, perhaps by some formula in another column:
 there is another XY coordinate that is EXACTLY 1 unit away in either the X OR Y direction
 there is another XY coordinate that is EXACTLY 50 unit away in either the X OR Y direction
 there is another XY coordinate that is EXACTLY 500 unit away in either the X OR Y direction
 other
0,0 (1 unit away)
0,0.1 (other)
0.1,0 (other)
1,1 (1 unit away)
2,2 (1 unit away)
3,3 (1 unit away)
100,100 (50 unit away)
100,150 (50 unit away)
150,100 (50 unit away)
500,500 (500 unit away)
500,1000 (500 unit away)
1000,1000 (500 unit away)
My list would not be ordered in any way.
(0,0) is not categorized as "other" due to the presence of (1,1). The "other" category is only used if there is no other coordinate that can be used to categorize.
What is the quickest way to do this? I may have more categories to add, but they would just be more if the same, only at different distances.
Also, is it possible to choose whether to use the "larger" (or "smaller") of the categories? For example, say we have these three coordinates.
0,50 (50 away)
50,50
150,50 (100 away)
But (50,50) could be either (50 away) or (100 away). I wouldn't consider any other categories except the two "nearest" categories; e.g. if there was one that fit (200 away), it wouldn't matter since there is one that fits (100 away).
I hope I explained my problem well enough!
My thanks to anyone who bothered to read this!
Hi,
How can I in Excels WorkSheet objects such as PlotArea or Shape using VBA and API determine pixel color at given coordinates. API function GetPixel requires handler  hdc so do Excels objects possess hdc and how can I get it? Or maybe there is another way to read pixel color ?
Hello VBA'liens,
I want to create a chart with 3 lines, whereas the 1st has it's ycoordinate
in column A and its xcoordinate in column B, the 2nd line has its ycoordinate in column C and its Xcoordinate in column E, the 3rd line has its ycoordinate in column D and its Xcoordinate also in column E.
Line 1 has 30 coordinates, Line 2 and 3 have 10 coordinates.
this is my code!
Code:
Sub Makro6()
Charts.Add
ActiveChart.ChartType = xlLineMarkers
' ycoordinates of line 1 in column A
ActiveChart.SetSourceData Source:=Sheets("Sheet").Range("A1:A30"), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
' Xcoordinates of line 1 in column B
ActiveChart.SeriesCollection(1).XValues = "=Sheet!R1C2:R30C2"
' Xcoordinates of line 2 in column E
ActiveChart.SeriesCollection(2).XValues = "=Sheet!R1C5:R10C5"
'ycoordinates of line 2 in column C
ActiveChart.SeriesCollection(2).Values = "=Sheet!R1C3:R10C3"
'Xcoordinates of line 3 in column E
ActiveChart.SeriesCollection(3).XValues = "=Sheet1!R1C5:R10C5"
'ycoordinates of line 3 in column D
ActiveChart.SeriesCollection(3).Values = "=Sheet1!R1C4:R10C4"
ActiveChart.Location Whe =xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = False
.HasAxis(xlValue, xlPrimary) = True
End With
ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlCategoryScale
ActiveChart.HasDataTable = False
End Sub
I hope you understood my problem, excuse my bad English.
Hopefully someone knows the answer...
Best regards,
Mux
I would like to plot 3D coordinates on a 2D surface graph. Each coordinate set would have its own 'Number' as referenced in Attached spreadsheet. This number should be used for the Legend in the chart. In the example there should be 9 3D coordinate points and thus 9 items in the Legend.
I have labelled the axes how they should be set out I just cant seem to get the graph to work the way I have described above.
The resultant for the graph would be a 2D surface between the coordinate points. Maybe I am using the wrong type of graph but any help would be appreciated in trying to get this to work.
Cheers.
I have a range of cells with data in each cell. The range is from C3 to S23. The data is coordinates to cells on another sheet. I need to create a macro that will go to the range, pick out the first coordinate, execute a function, then go back and select the next coordinate, execute a function and so on through all 357 coordinates. Can anyone show me a small macro that will do that? Something like:
Range(C3, C4, C5, C6... S23)
Pick first coordinate,
Excute function at coordinate
Go back to range and pick next coordinate
Excute function at coordinate...
At end of Range, exit sub
I have the execute portion of the macro down.
Thanks in advance,
Hi. I have many (200+) charts, generated by a frequently updated Excel 2007 workbook, that I need to use in a website. The charts must be 500 pixels wide by 300 pixels tall. XL confirms these pixel dimensions, along with an absolute size of 5.2 inches by 3.1 inches (corresponding to a resolution of 96 DPI).
If I copy and paste one of these charts into another application as a PNG or BMP, the 500 x 300 pixel dimensions are maintained. So far, so good.
BUT, if I copy and paste the same chart as a GIF, it's 780 pixels wide by 470 pixels tallfar too big for my webpage. And, more significantly, I get the same (excessive) chart size if I save the entire workbook as a web pagethe only practical option with 200+ frequently updated charts.
Windows reports the resolution of these bloated charts as 149 DPI. So, XL 2007 seems to be trying to maintain the original size of the charts in inches (5.2 x 3.1), rather than in pixelsbut with a target resolution of 149 DPI.
The XL web options settings "screen size", "resolution", and "allow PNG as a graphics format" have no discernible effect on the chart size or resolution.
How can I get XL 2007 to maintain the original pixel dimensions during a "save as web page" operation, like previous versions? Alternatively, how can I force XL to use a desired resolution (e.g. 72 or 96 DPI instead of the mystery 149 DPI) for exported charts? Thanks in advance!
Hi all, I'm Javier from Spain. Have been checking this forum for some time and it has been very helpful
What I'm trying to do is to make a chart clickable so that when you click on the date axis it will zoom to that date. The clicked date should then be the minimum value of the graph.
I have tried lots of things but have been completely unable to get the point the user has clicked on. I can get the mouse x coordinate but cannot find a way to translate it to the point coordinate.
Could you please give me some hint to do that? I could either translate the coordinates or if you can think of any other way please tell me so
Thanks a lot!
Hi,
I have 2 columns of data, one with distances and one with pixel values. Then, i have two columns that also have distances in them, forming a range. I would like to have a formula that looks at the range of values and then looks up those same values in the first column of distances and picks out the max pixel value from that. I tried Dmax, but it seems to only work with the first row because its directly below the criteria labels.
So, for example, I would like to look up the maximum pixel value within the range of distances listed (>.003 and <.023, for example). The columns look like this (with the distance and pixel column being longer, encompassing values throughout the ranges):
Any ideas?
Distance Pixel Distance Distance
0 168 >0.003 <0.023
0.00 176 >0.023 <0.043
0.00 178 >0.053 <0.073
0.001 179 >0.07 <0.09
0.002 155 >0.09 <0.11
0.002 160 >0.122 <0.142
0.002 170
0.003 159
0.003 165
0.004 153
0.004 159
0.005 156
0.005 162
0.005 169
0.006 152
0.006 158
0.007 145
0.007 145
0.007 147
0.008 130
0.008 142
0.009 133
0.009 152
0.01 137
0.01 146
0.01 157
0.011 145
0.011 154
0.012 141
0.012 149
0.013 153
0.013 161.52
Hi
i have work sheet that gets inputs from user and some of input are x and y value ... So user must open a manual chart and look for them but that take time from him so I thought if i can make it easier for user and let the worksheet do the job...but i stucked since i don;t have expierince with getting info from chart
i thought of two methods but before that let me explain how the chart looks like
ok ..x axis there's a value ranges from H to 5H (since H is known value)
and the same for y value ..
inside the chart there's intersected curved lines first group is oriented to west called phi angle (7 lines 20degree to 80 degree..20 . 30 . etc) and the secxond called psi f oriented to east) and have the same divition
However... by knowing phi and psi f value we go to there curved lines and take the intersection point and take it's coordinate and this coordinate is x y which we want it
i thought in two method
1 easy but longone
simply make phi , psif an index for x y but that will take long time for collecting all the value of chart and well be there a huge range 60 * 60 then 3600 (x,y)s
second i thought if it possible if we get the chart into the excel and take variable but this one i have no idea how it could be done i don't know even is that possible
please help me if you coule as i try help others thanx a lot
I have several black rectangular shape objects with rounded corners on my 2007 sheet. I have each one sized as wide as the black colored cells they overlap (or so I think). I've zoomed in 400% to make sure they were lined up properly and they look great at 400%.
When I zoom out to 100%, every one of the rectangles are aligned left to each cell correctly, but they are all 1 pixel shorter and look to be 1 pixel short on the right side of the cell.
But then when I print the sheet, the rectangular shapes in the printout appear to be 1 pixel wider and hang off the right side of the cell by 1 pixel. The left side is still aligned correctly.
Does anyone know what is going on and how I could fix this?
I could just make them 1 pixel longer so it looks right when viewing at 100%, but then my printout will look like it is 2 pixels wider and hang off the right side of the cells by 2 pixels.
For some reason, I cannot get my worksheet to display a cell's pixel value when I make a colum or row wider. Thoughts?
Hello
Where is my error
Code:
Sub Open_hypersnap_Small()
Dim shellstring As String
Dim x1, Y1, W1, H1 As Integer
Dim Coordinate As RANGE
Sheets("Sat_Sheet_Small").Select
x1 = Application.WorksheetFunction.VLookup(RANGE("Graphnumber").Value, RANGE("Coordinate"), 4, 0)
Coordinate is a range defined in my sheet
=Sat_Sheet_Small!$BJ$9:$BJ$12
Mousse over Range("Coordinate") give "Nothing" message
Martin
here is my problem.
i have set of 10 coordinates which make certain curve.
Now my task is for any given (x,y) dot to find distance from that curve (x coordinate,and y coordinate),so how far is that dot verticaly from curve
Hello,
Currently I am positioning a chart created with a vba macro by using
Code:
With ActiveSheet.ChartObjects.Add _
(Left:=325, Width:=750, Top:=600, Height:=300)
I would like to set the Top property with a cell. Is that possible? So instead of 600px I would like it to start at row 46 or whatever. I have multiple sets of data on a worksheet that need to be graphed. I would like to be able to position the graph by row instead of having to figure out where to start by pixel.
I've never seen this kind of feature in any program so..
You know when you open a picture using windows paint,
there's a coordinate on the bottom right of the screen right?
Now, Is it possible to make a macro that records the coordinate everytime i maka a dot using "pencil" feature in paint?
So everytime i click on a spot in the image (draw a single dot), excel would track the coordinates of these dots and write it vertically in 2 columns (x & y)... the result is something like this :
Code:
x y
125 148
143 180
152 185
230 155
280 186
280 154
207 133
207 70
246 95
281 121
282 94
337 82
320 95
342 100
356 109
350 159
346 202
I need to do this for 5000 dots so writing down those coordinates manually is gonna take forever, and the error risk is higher too ...
Or could you reccomend me a program that has such feature?
I've been googling it but found no such thing...
thanks.
I have two paired sets of XY (Cartesian) data. I need to correlate coordinate set XaYa n with coordinate set XbYb n from 1 to N. Suggestions or references?
Thanks
Hello Everyone,
I am importing some text files into an excel worksheet. I want to change the format just a little bit. For each date I have 5 rows (pixel: 25, 37, 50, 100, and 200). When I import my data the date is in the same row as my pixel numbers. I want to place the date in another column to the left of these pixel numbers.
Below is an example of my "spreadsheet" The first 5 lines (with date "2008_308.txt" next to each pixel number is what I want it to look like and the next (with date "2008_309.txt" is how it is imported with only one date above the pixel numbers. I could do this manually, but I have many years of data to import. And would like a way to kind of copy/paste these multiple items at the same time. Any ideas?
Thanks,
Melissa
____________ Pixel Area(%) Cumm. Area Count Area (km^2)
2008_308.txt 25
2008_308.txt 37
2008_308.txt 50
2008_308.txt 100
2008_308.txt 200
____________ 2008_309.txt
____________ 25
____________ 37
____________ 50
____________ 100
____________ 200
Does anyone have code that would give a source GPS coordinate when given multiple GPS coordinates and power levels? I know it won't be exact but given the input, hopefully provide a more accurate location of the source. Thanks!
Chris

