Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

drawing shapes using coordinates

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Drawing shapes using coordinates contained in cells

Drawing shapes using coordinates contained in cells

ResolvedVersion 2007

Frederic has attended:
Access Introduction course
Access Intermediate course
Excel VBA Intro Intermediate course

Drawing shapes using coordinates contained in cells

Hello,

I would like to insert circles on sheet (2) of my workbook using the coordinates stored in two columns on sheet (1).
These coordinates are stored as Letters (that will give me the column where to insert the shape) and Numbers (that will give me the row where to insert the shape).
Below is my code so far, but when I run it, it doesn't do much to my second worksheet, actually nothing.
Could you point out where is my mistake please?

Thank you in advance for your help.

Fred.

Sub PopulateKinomeTree()

Dim strCells As String
Dim LocationColumn As String
Dim LocationRow As String
Dim currentRow As Integer
Dim NumberOfRows As Integer
Dim myDocument As Worksheet


Application.ScreenUpdating = False


NumberOfRows = Worksheets(1).Range("D5").CurrentRegion.Rows.Count

MsgBox (NumberOfRows)


For currentRow = 2 To NumberOfRows

On Error Resume Next


LocationColumn = Worksheets(1).Range("D" & currentRow).Text
LocationRow = Worksheets(1).Range("E" & currentRow).Text


strCells = LocationColumn & LocationRow


Set myDocument = Worksheets(2)


myDocument.Shapes.AddShape msoShapeOval, Range("strCells").Left, _
Range("strcells").Top, 8, 8

Next currentRow

Application.ScreenUpdating = True


End Sub

RE: drawing shapes using coordinates contained in cells

Hi Frederic


Thank you for your question & apologies for the delay in getting back to you.

The Excel VBA trainer will respond to your question as soon as possible.

Thank you for your patience.

Regards,


Nafeesa

Microsoft Office Specialist Trainer

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Quickly insert a function

In Excel 97 and 2000 it was known as the Paste Function dialog box, these days it's known as the Insert Function dialog box. Regardless, one has to choose Insert|Function. or the fx button to open it up. There is, however, a non-mousey way to get hold of the Insert Function dialog box: press Shift+F3 in a blank cell to open the Insert Function dialog.

Press Shift+F3 after a function name and open bracket to open the Function Arguments dialog. For example, type =VLOOKUP( into a cell and press Shift+F3 to obtain a detailed description of VLOOKUP's arguments.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.