Find Position Of Rotated Shape?

May 7, 2012

I'm messing around with two shapes, a Cannon and Cannon Ball. With code the Cannon rotates for the angle of fire. What I can't do is position the Cannon Ball at the end of the Cannon when Cannon is at an angle. Long time since I was in school so forget most of my maths.

Code:
Sub IamUseless()
Rem this is work in progress and in NOT WORKING!!!!!!!
Dim xDistance As Double ' is inital x position of object

[Code].....

View 1 Replies


ADVERTISEMENT

Cut And Paste Shape Into Same Position

Aug 6, 2008

I am trying to cut and paste an object (an excel shape to be more precise) into its same position. It could, for example, be relative to the top left corner, but how to modify the paste method will be welcome. Surely this is a piece of cake for most of you, but I haven't been able to find the answer for objects floating on the screen.

View 5 Replies View Related

Change Shape Size / Keep Its Position?

Jul 10, 2014

I have an autoshape on an sheet, and use this code (it's a circle), to rezise it....

[Code] ....

However, it does rezise it, but the shape doesn't keep it's central position. Is there a bit of code I can add to stop the shape from moving? In other words, have the shape rezise around it's center of location?

View 4 Replies View Related

Lock Shape Position On Screen

Feb 15, 2007

I created a shape (rectangle). I assigned a macro to it, to activate another worksheet.

Can I fix the position of the shape on the screen, near the top. I have 700 rows in the worksheet and I want this rectangle always visible, near the top.

View 4 Replies View Related

Add Position Shape To Cell Location

Jan 15, 2008

i need to loop through a column of values and get each value

Dim LastRow2 As Long
Windows("SCFOutput.xlsm").Activate
Sheets("Q2SCNeg").Select
Columns("A:B").Select

ActiveSheet. Range("A65536").End(xlUp).Offset(1, 0).Select
LastRow2 = ActiveCell.Row - 1
For Each c In Worksheets("Q2SCNeg").Range("A2:A" & LastRow2).Cells
MsgBox ActiveCell.Value
Next c

i did this but it selects the first blank row (row 15) and gives me an empty message box 14 times (which is right, but i need 14 values) the reason i need the loop is because the number ov values will always change

View 2 Replies View Related

Resize Shape Based On Cell Position?

Oct 13, 2013

I want to resize a shape and set the height to a specific cell. How can I achieve that?

View 7 Replies View Related

Determine Position Of Shape/Button On Worksheet

Jun 2, 2008

I have written a small piece of code that handles clicks on buttons on an excel spread sheet. When a button is pressed, i need to know the row number where the button resides in.

I have searched and read about this issue on several forums, and they all indicate that i need to use something like

application.caller.topleftcell.row

to get the row number and

application.caller.topleftcell.column

to get the column number.

However, when i use the row variant, it ALWAYS returns row number 1. When i use the column variant, it returns the column number it is actually in.

i have added the full code that is creating the buttons below, and also the part that displayes the rownumber that is incorrect.

Private Sub Workbook_Open()
Dim name
Dim time As Integer
time = InputBox("Typ the hour you are checking" & vbCrLf & "eg: 7, 10, 13, 14, 15, 16, 17, 18, 19", "Which Check")

View 9 Replies View Related

VBA To Move Shape From Current Cell Position To Cell 1 Row Up

Nov 11, 2008

I require a macro to enable a selected shape to be moved from current cell location to relative position but 1 row up. eg topleft address = A4 and shift shape to topleft address = A3

View 5 Replies View Related

Text Is Rotated In Cell

Feb 5, 2007

as you see in the first coloum the text is on its side, how do i change it so it stands the normal way?

View 9 Replies View Related

Find Out If Shape Has Text

Aug 4, 2009

Have an .xls file with multiple sheets and many objects (Shapes) on of those sheets.
The objects are all rectangles, some of which contain text frames, where I had entered manually some text.

Also, each shape has a name.

Now, I want my VBA Macro to take a specific shape (using its name), and find out if it has text frame in it.

View 11 Replies View Related

Find The Value In A Column To The Nth Position

Feb 17, 2009

A simple question:
I have a column of numbers, for example:
2
5
5
8
8
8
20
50

I would like to know the value that corresponds to (for ex.) 5th position from, of course, the beginning of the column, ie 8.

View 2 Replies View Related

Find Position Of Last Particular Value In A List

Jul 18, 2006

What I have is a list of numbers, many of which are duplicated, in no particular order and I really want to avoid sorting. What I want to find is the lowest position in the list of a particular value. Unfortunaly MATCH only seems to return the first occurance of the value. Not really looking for a VBA solution.

View 8 Replies View Related

Find Position Of First Lowercase In Cell?

Jan 9, 2013

I have in the first column something like this:

GLOBAL DESCRIPTION
GLOBAL DESCRIPTION1 Particular description1
GLOBAL DESCRIPTION1 Particular description2
GLOBAL DESCRIPTION2
GLOBAL DESCRIPTION2 Particular description1
GLOBAL DESCRIPTION2 Particular description2

I want to to have in the second column:

GLOBAL DESCRIPTION1
Particular description1
Particular description2
GLOBAL DESCRIPTION2
Particular description1
Particular description2

So far I have this: +IF(EXACT(A1;UPPERCASE(A1));A1;+RIGHT(A1;LEN(A1)-(FIND(X;A1;1)-1)))

X standing for the position of the first lowercase, which I don't know how to get.

View 9 Replies View Related

Find Position Of Various Characters In String

Jul 11, 2014

Is it possible to find the location of different characters in a string (using VBA)? Normally I would use InStr of InStrRev option in VBA but my situation is a little more complicated.

The character I am looking for is not always the same, sometimes it is a , or a . or a : or a "blank" etc

I tried to do it like:
dim strChar as string
strChar = "[,.? /]"

SearchPosition = InStr ("cell location", strChar) (searchposition is the name of the function I am trying to make)

This works if I define only 1 character, this way it gives me a 0 as outcome

I have tried to change it to strChar = "[,]" or strChar = "[.]" or strChar = "[ ]" but this doesn't work.

View 13 Replies View Related

Find The Column Position Dynamically.

Jan 15, 2009

In the following code, you will find a sorting function with a range is hard coded. Instead of hard coded value which is marked with red colour, i need to find that range value dynamically. How to write a code to find that ?

View 2 Replies View Related

Find Position Of Control On Userform

Feb 14, 2013

I have a user form where two command buttons are set with the following code:

Code:
Private Sub CommandButton1_Click()
Frame1.Visible = True
Frame2.Visible = False

[Code]....

Now, when cmdbtn1 is clicked, frame1 is visible and vice-versa.

However, the position of both the frames on the user form are not on the same position on the user form. Indeed, it takes the position of the design view.

I want a code which will place the frame1 and frame2 at the same place and position on user form, irrespective of its position in the design view.

View 2 Replies View Related

How To Find Nth Position Of Character In A String

Jun 12, 2014

I am trying to work out how to get nth position of a character in a string. For example in this

Code:

kjishdfiuayigdscka
if I use the formula
Code:
=FIND("i",I$1),

it will give me answer 3. But I want the position of 3rd "i" in the string. The answer should be 12. How can I change this formula to get the correct result?

View 9 Replies View Related

Find The Position Out Of Played Numbers

Mar 18, 2009

*ABCDEFGHIJKLMn8OPQRSTUVWXYZAAABACADAE1n1n2n3n4n5n6n1n2n3n4n5n6n7n8n9n10n11n12n13n14n15n16n17n18n19n20n21n22n23n24Position 24567141517192223272834353639404143464748493;223268103048456714151617192022232830343637383941434446485;16;20:24421432364148456791014151718202328303438394041444647485;9;2159173537384645679101416182023273032343839404144474849620253542454645679101416182327283234353738394043444647497131423414748567810141617202528303435363839414244454647

I have selected numbers to play in the table shown above from cell G2:AD7 and celebrated draw result numbers are shown in cells A3:F7

Now, suppose I want to play the numbers, which are in cell G2:AD2 and the draw-celebrated numbers are shown in the cell A3:F3.

Now I want to check cells A3:F3 with G2:AD2 and want to know in which position are the celebrated draw matched with the numbers played.

In this case the result in AE2 will be 3; 22 that means only two numbers are matched with the played numbers. Those numbers are the number ‘6’ which is in the position 3 counting from G2 and number ‘48’ which is in the position 22 counting from G2 again.

The result must be shown in column AE for all the draws as shown in the table above.

View 9 Replies View Related

Find Closest Space To The Left Of Specified Position And Then Split

Dec 9, 2013

I'm looking for a way to split a cell with text into two cells. The first cell can only contain up to 40 characters, the rest needs to go in the second cell. However, I don't want the text to be split in the middle of a word. So basically, if the text is in cell A1, I need to find the closest space to the left of position 40 in A1, and move anything to the right of this position to B1. Example:

Original text:
A1: One green apple and a bucket of small onions that smell nice

I want to avoid this:
A1: One green apple and a bucket of small on
B1: ions that smell nice

I want to achieve this:
A1: One green apple and a bucket of small
B1: onions that smell nice

View 4 Replies View Related

Find Cell Reference Containing Specific Value From Current Position Up

Jan 29, 2009

I'm having some difficulties in defining my formula. I'm pretty sure that this should be possible.
I have a table containing values and dates. For each change in dates, I should summarize every value for that date. I cannot use the autosummarize function, because I do not want the sum to be beneath the values, rather in a column to the right of the values.

I have created a formula which checks for a change in date: =IF(C15=C16;0;1) where the C column contains the dates. Basically I say that the Index column should contain a 0 if the date is the same as previously registered, 1 if it is a new date.

The index column is used in some conditional formatting rules, so I would like to keep it anyway.

View 7 Replies View Related

Find Latest Delay Position Of Each Number Which Is In The Game

Mar 31, 2009

Find latest delay Position of each number which is in the game

View 9 Replies View Related

Find Column A Cell Value If It Exists For Current Cursor Row Position

Dec 1, 2012

trying to find the value of column A (date field) if it exists on the row that the cursor is presently on. I'm trying to check for the value before performing the next function to make sure the user is on a valid row. Cursor could be on any column A to F. Columns are always 6 but the rows can vary.

View 7 Replies View Related

Change Shape Text Without Selecting Shape

Mar 4, 2009

when i run the below code i get an error 438 'object doesnt support this property or method'

View 2 Replies View Related

Excel 2007 :: Primary Category Axis Title Rotates With Rotated Value Axis Titles

May 13, 2014

I've put together code to construct a chart

It all works fine but I've noticed an odd quirk which I can't explain nor can I seem to fix. Here's the (reduced) code :

Code:
Dim appExcel As Object ' Excel Application
Dim chtPareto As Object ' Chart
Set appExcel = CreateObject("Excel.Application")
Set chtPareto = appExcel.Charts.Add
With chtPareto
' Primary category axis

[code]....

The category (x) axis title should be horizontal, whereas the value (y) axis title should be rotated. Stepping through the code, when I .SetElement for the category axis title, it appears horizontal as planned. However, as soon as I .SetElement for the rotated value axis title, the category axis title also rotates.

View 3 Replies View Related

Position Cell In Top Left Position

Jan 7, 2009

Is it possible to position a predetermined cell (e.g. A42) in the top left corner of the screen. (Not every screen users use has the same size)

View 3 Replies View Related

Locate A Shape Within A Shape

Jan 24, 2014

On the attached spreadsheet there is two irregular shapes. "Area1" & "Area2". I need to be able to determine which area the "ball" shape is located in. If the ball is in Area1 then "Multiply 8" gets the ball and "Multiply 9" moves to the blue cell "AH39". If the ball is in "AreaB" Multiply 9 gets the ball and "Multiply 8" runs to cell "S37"

I should be able to do the moving of the shapes using all the samples, its determining which area the ball is in is the problem.

In the real spreadsheet i will probably have around 10 different Areas.

Move Two Objects - Select Case.xlsm‎

View 5 Replies View Related

If Formula: =IF(D4<0.38,"Thin",IF(0.38<D4<=0.48,"Good Shape","Bad Shape"))

Jun 23, 2009

I have D4=0.42. I thought this formula =IF(D4<0.38,"Thin",IF(0.38<D4<=0.48,"Good shape","Bad shape")) was supposed to give me "Thin" for D4<0.38, "Good shape" for 0.38<D4<=0.48 and "Bad shape" for the contrary, but it only gives me "Bad shape" when D4 is clearly between 0.38 and 0.48.

View 4 Replies View Related

IF On Shape

Aug 24, 2009

code doesn't work

Sub test()

If ActiveSheet.Shapes.Name = ("five") Then
Range("B4").Select
Else
Exit Sub

End If

End Sub

View 9 Replies View Related

Change Shape Name

Feb 2, 2010

I have a shape in Excel called Canada. I grouped it with another shape and want this new grouping to be called Canada. But when I enter Canada in the shape name entry box, it doesn't actually change it (as it thinks I am referring to the existing Canada).

I need something like Names manager, but for shapes, not ranges.

View 9 Replies View Related

Shape A Textbox

Apr 1, 2008

Is it possible to find out if the selected item is a textbox through VB?

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved