Add Position Shape To Cell Location
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 Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Lock Shape Position On Screen
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 Replies!
View Related
Cut And Paste Shape Into Same Position
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 Replies!
View Related
Determine Position Of Shape/Button On Worksheet
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 Replies!
View Related
Add Shape To Cell With Cell Value Change
The Following works great in it's own workbook, however it will not run in mine. Is it because I have other macros running? This is the error that I'm getting. Automation error (Error 440) Option Explicit Private Sub Worksheet_Calculate() If Range("N10").Value = "1.0" Then ActiveSheet.Shapes("AutoShape 578").Visible = True Else ActiveSheet.Shapes("AutoShape 578").Visible = False End If
View Replies!
View Related
Add Shape & Rotate
i am trying to draw a shape (square or rectangle) using vba textbox's i have managed to draw 2 of the 4 lines. i am stuck on the ShapeRange.Flip msoFlipHorizontal codeing. i have attached a example of what iam trying to do. the coorinates from the last line enterd are saved to sheet1 for use with the next line entered ...
View Replies!
View Related
Add Shape (Arrow) To Worksheet
This one has me baffled: I recorded a macro to add a shape to a worksheet, very simple. When I try and run it it comes up with a "The specified value is out of range" error. I've searched the net and it seems to come up where the file has been converted from an earlier version of excel (which this file has) but I haven't been able to find a work around for it. The relevant code is With ActiveSheet .Shapes.AddShape(msoShapeLeftArrow, 205.5, 312#, 144#, 23.25).Select End With
View Replies!
View Related
Dynamically Add A Hyperlink To A Shape In VBA
I am trying to create a table of contents for a very long list of items on a sheet. I am using shapes on a seperate sheet to act as buttons, that go to the location on the correct sheet using a hyperlink. I found how to add a hyperlink using a macro, but I can't find how to create a hyperlink for the shape using a macro. What is the code I would need to set a hyperlink to "Sheet1!A2:Sheet1!C2", with the a tooltip of "Some text"? Here is how I create the shapes: With myDocument.Shapes.AddShape(msoShapeRoundedRectangle, 10, IntVerticalOffset, 630, IntHeight) .Fill.ForeColor.RGB = RGB(204, 255, 204) .Line.ForeColor.RGB = RGB(0, 0, 0) .TextFrame.Characters.Text = StrRowName .TextFrame.HorizontalAlignment = xlHAlignLeft .TextFrame.Characters.Font.ColorIndex = xlAutomatic .TextFrame.Characters.Font.FontStyle = "Bold" .Locked = True End With
View Replies!
View Related
Change/Modify/Add Text In Shape On Non-Active Worksheet
I have a button on say, sheet1 with text that I want to change after a certain action takes place; however, I was trying to change this text without switching sheets. (switching sheets isn't a big deal, I'm mainly trying to do it my way for the practice). I'm able to select the button on the other sheet without actually switching sheets, but when it comes to changing it's text I get an error. Here is the code I tried: Sub macro1 () Worksheets("sheet2").Select Worksheets("sheet1").Shapes("Button 2").Select Selection.Characters.Text = "Done" End Sub Problem with this is it gives cell A1 on sheet2 the "done" text. I also tried this...but it gives the error. Sub macro1 () Worksheets("sheet2").Select Worksheets("sheet1").Shapes("Button 1").Select With Worksheets("sheet1").Shapes("Button 1") .Characters.Text = "Done" End With End Sub
View Replies!
View Related
Add Sheet To Workbook In Certain Position
I execute code to open Excel, add a workbook, and then add a 4th worksheet to the workbook. The first time through the code it works like a charm. When I execute the code the second time, I get the following error: Error Number 1004, Method 'Sheets' of object '_Global' failed. Dim xlApp As Excel.Application Dim xlWB As Excel.Workbook Public Sub CreateCSVs(dtBeginDate As Date) On Error Goto HandleError Dim N As Integer Dim I As Integer Dim P As Integer Dim strDsrc As String Dim strDsrcDesc As String Dim strDsrcCode As String Dim strDsrcId As String Dim strDate As String Dim strTime As String Dim strFileName As String Dim strSheetName As String Dim strTableName As String..............
View Replies!
View Related
Add Custom Menu At Specific Location On Toolbar
I would like to use the attached "menu maker" file I found on Ron De Bruin's site using a Sheet to build the menu, yet be able to place it before the Help menu as suggested by this site [url] by finding the position of Help. I have amended the code yet receive a "Compile error: Variable not defined" error.
View Replies!
View Related
Interpolation Given A Variable Table Location & Location Of Data Within
I am trying to develop a spreadsheet that will calculate a cost based on a matrix. I am attaching a sample of the calculation created so far. The end result is in cell M13 and is highlighted in yellow. I kind of layed the formula out in a few different cells, so hopefully it would be easy to follow. simplify this process with maybe another formula that I might not be aware of, or maybe show me how to get this done in VB code. I think VB code would be the correct way to go just not sure.
View Replies!
View Related
Shape Size Dependent On Cell Value
I'm trying to make a circles size (diameter) change depending on a value inputted in a cell, preferable I would like to have a limit to the sizes too so if that the circle will not have a diameter larger than 20 or smaller than 2 regardless of the values put in. the sheet will have several circles. I know this must be documented somewhere but I don’t think I’m using the right terminology in my searches,
View Replies!
View Related
Inserting Pictures And Resize To Active Cell Shape
I now have this code that inserts a picture and then resizes it the active cell shape. Sub InsertPicture() Dim myPicture As String myPicture = Application.GetOpenFilename _ ("Pictures (*.gif; *.jpg; *.bmp; *.tif),*.gif; *.jpg; *.bmp; *.tif", , "Select Picture to Import") If myPicture "" Then ActiveSheet.Pictures.Insert (myPicture) ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Select With Selection .ShapeRange.LockAspectRatio = msoFalse .ShapeRange.Height = ActiveCell.RowHeight .ShapeRange.Width = ActiveCell.Width .Placement = xlMoveAndSize End With End If End Sub
View Replies!
View Related
Paste Random Cell Content To An Auto Shape
I am looking for a macro that will copy the text-based contents of a random cell in the range B100:B135 to a callout text box. The name of the callout is Autoshape 13. The callout should be cleared before pasting the contents of the next random cell into it. This macro will be assigned to a button.
View Replies!
View Related
Referencing A Cell Based On Position Of Another Cell
Right now cell B7 is referencing cell D3. However I want this to be dynamic in the sense that suppose I change the Phase 2 (which starts from ww3 (cell D3)) to ww5 (cell F3) then I would like that B7 should also get updated to F3 instead of D3. Basically the Development phase of "Support" Project starts only when Phase 2 of "Project 1" starts. ww = Work Week. In short cell B7 should always be in sync with the ww of Phase 2 of Project 1.
View Replies!
View Related
Adding Up Cell Position Not Values In Cell
I have a spreadsheet with two columns and 39900 rows, from that data I want to create two new columns so cell C1 = A143 and D1 = B143, C2=A286, D1=B286, and so on. The row location increases by 143. The simplest thing I tried to do was to say C1=A1+142, but (knowing it is wrong) I get a #value error. How can I tell excel to grab these values located every 144 rows below and create two new columns?
View Replies!
View Related
Referring To A Cell For The Row Position On A Formula
I'm trying to find the details required to refer to contents of a cell and then treat the value as the formula. IE for Sum(B5:B8), i'd like to have two cells, one with a 5 in it and one with the 8. I know its possible if i put "b5" as the cell content using indirect - but I'll be using the same cell value to update formulas in different columns so I cant afford to include the B. I assume theres a very simple method along the lines of Sum((B&(Cell(a4)):B&(Cell(a5)))?
View Replies!
View Related
Formula For Cell Value Based On Reference Or Position
HTML Imagine the following table (Ax, etc is the cell position): A1=John C1=Name D1=Date E1=Version F1=IP A2=10/2/2008 C2=A1 D2=A2 .... .... A3=Client version 7.01 C3=A1+5pos D3=A2+5pos A4=172.24.3.5 C4=A1+10pos D4=A2+10pos A6=Michael A7=10/2/2009 A8=Client version 7.03 A9=172.24.3.80 A11=Susan A12=2/2/2007 A13=Client version 7.02 A14=172.24.3.200 I have a table of data on the left side and I want to re-organize just like the right side. Let's take C2 as an example, the value for that cell = A1; Now, C3 in the other hand, the value for that cell = A1 + 5 positions down; C4 = A1 + 10 positions down;. The same type of formula applies for the remaining columns on the right. This seems like an easy solution, but it's not easy when you don't know it... :
View Replies!
View Related
Finding The Location Of A Cell
i am trying to find the location of the current cell and use the information to print it to screen. For example, if the cell A1 is selected, i need to get the location A1 and use this value for a vlookup. is there a method that returns the current cell location "A1"?? activecell.address
View Replies!
View Related
Increment Cell Location Up By One Cell For A Column
Increment all cells located in Column H up by one (the one above it) cell Except for the header cell (since its the header)(H1), H2 will always be a blank due to the make up of my database so that will not cause the header to be re-written. Column H is not an entirely filled column and some cells are empty (if this info was needed in optimizing the code), Im seeking the quickest and easiest way of implementing this since the database is very large.
View Replies!
View Related
Find Cell Reference Containing Specific Value From Current Position Up
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 Replies!
View Related
Select Cell Range Relative To Starting Position
I need to change multiple conditional formats which apply to cell ranges 1 row x 17 columns wide. The specific change I am making is able to be acrried out with the code With Selection.FormatConditions(1).Font .ColorIndex = xlAutomatic End With However, I dont want the user to have to manually select each 17 cell area. I WANT THE USER TO JUST MANUALLY SELECT THE FIRST OF THE 17 CELL AREA. I want to write a macro that will THEN select a row of cells, 17 cells long, from the MANUALLY SELECTED position as at the moment of running the macro. Unfortunately the cells are not always on the same row in each sheet. On one sheet they may be on row 5, on another row 8 and on another, row 15 etc. I was wanting to be able to select a 17 cell range 'relative' to where the cursor is. How do I write the code to select the relative cell range? Is there an answer in an R[1]C[1]:R[1]C[17] sort of code?
View Replies!
View Related
Position Insertion Point In Cell While In Edit Mode
When a user clicks a cell in Column A, VBA will enter the date in the cell (in the form MMDDYY) and will position the insertion pointer at the end of the date. The user can then enter a four digit number following the MMDDYY. In this worksheet, Column A holds a transaction number, which is always in the form MMDDYYXXXX. I am trying to save the user the trouble of entering the MMDDYY, since it will always be today's date.
View Replies!
View Related
Move/Cut Cell To Another Location
I would like to how I can move the words "Total List Price" over to column "C" rather than have it displayed in column "A". If someone can please advise me as to what part of the code I must change in order to have these changes take place Private Sub CommandButton1_Click() Selection.SpecialCells(xlCellTypeFormulas, 16).Select Selection.ClearContents Range("A8").Select Selection. Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(6, 9), _ Replace:=False, PageBreaks:=False, SummaryBelowData:=True Application.Goto Reference:="models2" ....................
View Replies!
View Related
Save To Specific Location As Cell Name
I've been searching for ages trying to work out how to do this but have so far only managed to confuse myself. i have office 2007 and I have found some code to convert an excel sheet to PDF, however I need it to saveas the contents of cell (e6) and save to a location on our network drives (C:TEMP).
View Replies!
View Related
Formula To Calculate Cell Location
i'm not sure how to describe this. i've never had to do this before. here is what i'm trying to do. and it's not working. =MIN(B2:B(G2-G3)) basically instead of saying =MIN(B2:Bx)....i want the "x" to be variable based upong the G2-G3 condition. can this be done some other way?
View Replies!
View Related
Store Cell Location In Variable
way to store a cell's location to variables. Something like: int a, b Cell(a, b) = ActiveCell I'm currently working with a fairly large worksheet, and I'm using Cells. Find to look for a specific cell. Then I want to Filter that column, but I can't figure out what column Selection.AutoFilter Field:=? should be.
View Replies!
View Related
Cell Value Based On Mouse Location
Is there a way to have excel track where my mouse is hovering(say if I have it hovering over cell A4) and have it return the value of A4 in a different cell (e.g B7)? This would occur in real time - that is, as my mouse moved over the spreadsheet, B7 would update in real time. Note I would also accept someone selecting the cell - hovering (no select) would be ideal but selecting is OK.
View Replies!
View Related
Copy Cell Values While Id Value Is Same To New Location Then Repeat For New Id Value
what I need to do is , while an id value is constant copy 2 adjacent cells to a new location on the same row as the first occourance of the id value, then if the id is the same on the next row repeat the copy and add these 2 values to the cells next to the ones previously copied. Once the Id value changes then the copy restarts on a new row which is the same as the first occourance as the new id value and repeats the same sequence as described in the first statement. I have attached a sample spreadsheet showing an example of the source and how I would like it to end up, the colour is only there to seperate the outcome from the source and is not required in the code.
View Replies!
View Related
Find MIN Location, Show Cell Next To It
I imagine this is pretty simple but for the life of me I can't figure it out. Here's what I want to do... Find MIN in Column F After finding the MIN in F (let's pretend F222 is the current min) Show the text in the field next to it (in this case display text from E222)
View Replies!
View Related
Creating Variables Based On Cell Location
if Row i Column j is activated then a corresponding variable Aij, Bij, Cij or Dij would be created (if not already existing), or cumulated by 1. The problem as I see it - completely generalised - is to create a variable where the variable name itself is formulaic, as well as its value. I know SAS would have no problem with this due to the order in which it parses data steps, but I'm pretty amateur with other programming languages so I don't know if this is blindingly obvious or downright impossible!
View Replies!
View Related
|