Using Data Stored In A Variable To Draw A Shape

Jun 18, 2014

I have some code, in one part of it I am storing a number (between 1 and 8) as Integer. Is it possible to reference this variable to draw some rectangles on a sheet, sort of

"If MonitorDetail (this is the name of the variable) .value = 2 then

Here I place the code to draw the rectangle on the page. The macro currently stops at Monitordetail with a error telling me its a "Invalid Qualifier".

View 1 Replies


ADVERTISEMENT

Right Click Button That On Action Draw Rectangular Auto-Shape?

Nov 2, 2012

I have a bit of code that I saved as an add-in. The code does a couple things: (1) Creates a right-click button that on action (2) draws a rectangular auto-shape that is the size of any selected range.

The add-in seems to loaded correctly.

However, when I launch a new excel sheet, my intent was to have the code (the right click option) be available whenever I opened Excel.

Is there another step to accomplish this?

View 7 Replies View Related

App To Draw Curved Shape To Scale With Drag & Drop Capabilities

Dec 13, 2006

I am researching the possibility of using Excel 2003 WITHOUT a Cad or Drawing package to simulate a drawing. (Consultants inquiries are WELCOME). The idea is to prompt the user (Sales Rep or Customer) for a few key dimensions and then plot out a closed curve based on the coordinantes entered. This shape, which would need to be accurately scaled, would then be sectioned and used as a canvas for dragging and dropping various icons.

Why use Excel instead of CAD?

Other than "everyone" having it, the placement of the "icons" relative to the perimeter of the curve will be used to estimate material costs and generate a quotation like a configurator application.

Key hurdles seem to be the drawing of a curve with cells as pixels and using drag & drop with custom icons - possible as an Add-In?

View 9 Replies View Related

How To Reference A Variable Stored Within Another Variable

Jul 27, 2009

how to achieve what I'll call "parameter driven" code where the "parameters" are variable names.

For example, in the following code... I'm looking for an answer to the question posed...

Sub Test_Sub()
Dim vX, vY, z
vX = 10
vY = "vX"
For z = 1 To 3
'This next line generates a Run-time error... But...
'=====================================
MsgBox z * vY '

View 9 Replies View Related

Using Workbook Name Stored As A Variable

Jul 27, 2006

I am opening a workbook using a macro. I need to run a macro in the workbook I am opening when it opens. I have created a variable containing the workbook name but don't know how to use it to run the macro.

Dim WBName
WBName = ActiveWorkbook.Name
Application.Run _
"'DIST_91094_EDTABS_DIABETES CARE_07072006.xls'!aStartProcess"

'DIST_91094_EDTABS_DIABETES CARE_07072006.xls'! needs to be replaced by the name stored in WBName

aStartProcess is the name of the macro in that workbook I want to run.

View 9 Replies View Related

Correct Syntax To Add Workbook Name That Is Stored In Variable Into Formula?

Feb 24, 2014

I have the following code, which executes just fine:

[Code].....

The problem is that I need to run this again in a different column, and the data is held in another sheet that I have given the variable StepTwo to.

I'm not sure of the syntax to do this. Basically - this is what I need the code to do:

[Code] ....

Understandably this is totally incorrect, but it's the best I can do to explain what I'm actually trying to do....

The two parts of SUMIF are both held in a workbook that I've given the variable "StepTwo" to. Both sets of data are also held on Sheet(1) of that workbook.

View 7 Replies View Related

"Countif" Function Stored As Variable In Macro?

Feb 2, 2009

Is it possible to use a "countif" function as part of a macro?

Here's the situation. In workbook "A", I want to look at a range of cells ("O19:O248") and count the number of times "apple" appears within that range. If "apple" appears 20 times, I would like the variable v_applecount to = 20 so that I can call that variable in workbook "B"

Note, I essentially want to do something like this in the Macro:

v_applecount = CountIf(O19:O248, "Apple")

View 5 Replies View Related

Can Draw Shapes Or Angles Based On Data

Apr 16, 2008

Can Excel Draw Shapes or Angles based on Data?

I have a radiation Excel file that solves for Radiation intensity using Distance and shielding as reducing factors.

Similar to a circle of light being less intense with distance so is radiation.

I need excel to draw a circle from a point specified based on a value I give.

For example at 1 ft I might have 500 R in 1 hour (life threatening!)

At 16 feet I have about 2 R in 1 hour (not safe for too long)

These circles would be overlayed on an map.

I would like to draw a new circle at various distances, simialar to a bullseye.

I would also like a triangle drawn based on angles and SIN / COS / TAN formulas

Could this be done in VB or preferably without.

View 11 Replies View Related

Excel - Draw Rectangle From Two Data Points?

Sep 5, 2013

I want to put a length in one cell and a width in another. Then have excel draw a square/ rectangle to this size. It could just outline cells, each cell being one inch or any other way.

View 9 Replies View Related

Find Spaces In Stored Data

Aug 13, 2008

I have a spreadsheet with data and I need to find text with spaces in one of the columns. How do I do that?

View 9 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 VBA Input Box Incorrect Data Being Stored?

Aug 1, 2014

I just want to ask the user to enter the date in a mm/dd/yy format, however, the date received is some how changing.

For example I execute the following code and get 8/01/14 instead of 8/21/14

[Code].....

I have even tried pulling the date from a formatted cell with no luck.

View 5 Replies View Related

Using EXCEL Formulas With Data Stored On MS ACCESS?

Jun 5, 2013

I am trying to find out if it possible to directly "access" (no play on words here) data stored on MS ACCESS by using Excel's formulas.

I have a set of tables stored on a Microsoft ACCESS 2010 database, and I want to use Excel to analyze that data, using formulas, such as SUMIF.

Is it possible, once I have established an Jet OLEDB connection from Excel to Access, to then directly exploit the data stored on Access without having to copy the data to Excel, and then use it.

I would like Excel to solely act as a tool to analyze, not to store data.

View 7 Replies View Related

Matching Patient Personal Data To That Already Stored In A Database

Jun 16, 2009

I am trying to write a macro to transfer patient personal data onto a database.

On sheet 1 the user inputs the patient surname, forename, date of birth, date of test and the test results.

On sheet 2 is the database, where patient surname, forename and date of birth is stored in columns A, B and C respectively. The remainder of the columns on each row is available for scoring test results.

What I would like the macro to do is as follows:
•Read the patient surname as input on sheet 1
•Check on sheet 2 if that surname already exists
•If it does, check if the forename and date of birth also match to sheet 1 for that particular entry.
•If a match is found then copy the test results into a column on that particular row. E.g. could be copied into column D.
•If no match is found, then all the data is entered as a new row on the database (I’ve written the code for this bit but thought I should add it in for clarity)

This will then allow all test results for a particular patient to be read off the same row in the database.

View 13 Replies View Related

Excel 2013 :: Populate First Worksheet From Data Stored In Several Other Worksheets?

Feb 19, 2014

I have made a Rota of sorts using Excel 2013 Desktop Edition for my charities volunteers (and stored it as a shared file via office 365 server that they can download and edit) and this rota is populated by our volunteers manually. Each day our controller needs to check the file to see who is on duty at that time.

How the Rota is populated.(the bit i managed to do myself)

The volunteer (Person A in this example) would open the excel file and go to the month they wish to choose a shift for (ref worksheet: FEB in this example). They would then pick a shift that suits them and click on the cell (ref: F32) that shows a vehicle available, then from the drop down list they select their name and then save and close the sheet.

Rather than our volunteer controller going through the sheet for the current month (ref worksheet: Sheets JAN to DEC) I would like them to use the first sheet in the workbook (ref worksheet: DC Info Page) to get an instant view of which volunteer is currently on shift.

My current problem

I don’t know how to make the excel file do the following

Search sheets JAN to DEC (ref cells: C4:I58 on each sheet) inclusive for the cell that contains today's (current actual) dateCopy the 8 (eight) cells below the cell that contains today's datePaste the copied cells in to the relative cells (ref: C8 to C15) in sheet one (ref worksheet: DC Info page)

I would also like this to be done automatically so the controller does not have to click on anything after they open the file. But if it needs a button to process the request, one could be added to the worksheet (ref: DC Info Page)

View 1 Replies View Related

Using SUMIFS On A Large Amount Of Data - Numeric Value Stored As Text?

Aug 1, 2012

I was using SUMIFS on a large amount of data, but wasn't getting back the exact sum that I needed.

It turns out that I had cells with values similar to the following

Code:
000123
0123
Basically, text fields with the same numerical values, except for the number of leading zeros. Due to the nature of the table, the number of leading zeros is important.When I did SUMIFS, it counted the sum of the two values together. For example with the following:
Item
Batch
Qty

ABC
123
1

It appears that even if a numeric value is stored as text, SUMIFS treats it like a number.

View 3 Replies View Related

Find The Closest Match To Given Latitude / Longitude From Data Stored In 2 Columns?

Feb 2, 2014

I have 2 different sets of data: temperature data recorded at meteo-stations defined by latitude / longitude, and major world cities also defined by latitude / longitude.

After the user chooses the station's coordinates, temperature data is pulled out from the first data set; this works! However, I would like to be able to provide information about the closest city to the chosen meteo-station from the second data set.

File attached with sample data sets.

View 14 Replies View Related

Data On Clipboard Is Not Same Size And Shape As Selected Area?

Dec 15, 2013

How to turn off or default the warning box message ...

"Data on the Clipboard is not the same size and shape as the selected area. Do you want to paste the data anyway"

I hate having to click yes on this every time I paste something. I do it hundreds of times a day.

My tables is centered and merged because my external date changes sizes each time I paste to the table.

I have looked all over to try and find an "OFF" warning/message button for this. I just want to know how to turn it off or default it to never pop up again!

View 4 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

League Cup Draw By Using VBA

Dec 3, 2009

i want to make a cup draw, but i don't want to use RAND, I want to use VBA.

What i want is to make a English Football League Cup, so all 92 leagues teams are in it, but as follows

First Round 72 teams
Second Round 50 Teams
Third Round 32 Teams
Fourth Round 16 Teams
Quarter-Finals 8 Teams
Semi-Final 4 Teams
Final 2 Teams

for a team list see attached excel spreadsheet

If you are not sure what i mean google search English League Cup or try soccerway

I want a command box or similar for each round, i dont want it to change unless i click on the command button again.

i will be inputing the scores myself.

Sorry i forget one team in the First round "Darlington"

View 14 Replies View Related

Random Draw

Dec 1, 2008

I was looking for some code to randomly generate a number for a prize draw I am doing. I found a great piece on this site, which I have slightly changed to give me what I have below.

It works great except for one thing I cannot work out, I have the code below working on cell "C1", I would like it to work in cell "C5", but I can't seem to work this out.

Sub SlotsNum()
Dim w As Long, x As String, y As Long
Randomize
x = Format(Int((Range("B2") - Range("B1") + 1) * Rnd + Range("B1")), "0000")
For y = 1 To 1
For w = 1 To 250
Range("C" & y) = Int(8000 * Rnd)
Next w
Range("C" & y) = CInt(Mid(x, y, 4))
Next y
End Sub

Also, whilst here. i will have one other problem, with it being a prize draw I do not want to draw the same number twice. At the moment I have a small macro that copies the winning name that appears on the main screen (via a vlookup) onto a winners spreadsheet. I am thinking of then creating another macro that replaces the winning name on the master list with an "Already Won" entry, so we can just select again.

View 9 Replies View Related

Draw A Circle

Apr 4, 2009

Ive been trying to draw a circle in excel, although it only draws ovals - Is there a way to draw a circle in excel?

View 9 Replies View Related

Combinations - Win Or Draw

Nov 28, 2009

I'm creating a spreadsheet regarding football teams and want to lis thte combinations of results for each team.

Specifically, if the team will win or draw.

So, I have 6 teams, each team can either win or draw.

I want to display the combinations of team 1 winning AND team 2 winning AND team 3 winning etc.

View 9 Replies View Related

Draw Line On Userform

Jan 22, 2010

Is it possible to add horizontal lines to a user form, like as shown in the attached image. I know about frames, but unsure how to get just one horizontal line.

View 3 Replies View Related

Set Cursor To Draw Connector In VBA

Dec 18, 2012

i have faced a problem i want to draw straight connector using code imagine when you select straight connector to draw line mouse cursor changes when you move it to a node i want to do this with excel vba code without going to shapes and selecting connector.

View 5 Replies View Related

Draw A Border Using Line?

Aug 14, 2013

I'm trying to use VBA to draw a border using the drawing toolbar and using the line. i need it to draw a border around a select area i hightlight.

i have attached a example below, but not sure if it will appear.

View 1 Replies View Related

Draw And Delete 1 Line

Mar 7, 2014

I have this Command button that switches on and draws a line. If you press it again then I need to delete that line.

If I push the button multiple times Excel keeps changing the name of the line. I have multiple lines on the same worksheet and text boxes but only this 1 line needs to be delete. I would think that theres a way to assign a permanent name to this line and delete and recreate it but...

ActiveSheet.Shapes.AddConnector(msoConnectorStraight, 319.5, 77.25, 319.5, _
245.25).Select
With Selection.ShapeRange.Line
.Visible = msoTrue
.Weight = 1.25

[Code]....

View 3 Replies View Related

How To Draw A Line In Userform

Dec 30, 2009

I have a 5-column listbox in a userform. I do not know how to make the column borders visible. If somebody can tell me, that would be great.

If not, then the next alternative would be to manually draw a line. I tried to so one, by creating a Label with a width of 1, and backcolor ot black. This works but not in front of a list box. For some reasons it cannot be brought to front/forward (order) of a listbox, I already right-clicked several times and sent tthe order to front.

Is it possible to bring it in front of a listbox?

View 9 Replies View Related

Draw Every Worker And Display Compensation They Got?

Nov 12, 2013

I have attached a very simple example of what I am trying to achieve.So we have 2 sheets. a sheet called data and a sheet called results.

the data sheet, includes ID's of employees and what they are measured on - Hours and Accounts Finished.For example, worker 123 put in 100 hours from the 200 expected and finished 100 accounts from the 200 expected. The main sheet called Results looks up in a list every ID and displays in a table the compensation the worker got. Each time you select from the drop list a different ID number it shows the result and the amount of money they got.

I want to be able to draw every worker and display the compensation they got('Results', H11) in the Pay amount column('Data',H3:H11).

View 6 Replies View Related

Macro To Draw The Cell Border

Sep 30, 2009

Since I did not know how to do this I used the record macro cheating option.

Excel spit out this chunck of

View 6 Replies View Related







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