Excel VBA Introduction Part 52.1 - Introduction to Shapes

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ย. 2024

ความคิดเห็น • 74

  • @paulaparo1583
    @paulaparo1583 3 ปีที่แล้ว +2

    Another outstanding tutorial! Thank you so much, Sir. Four years after publication these videos are still adding value to Excel vba programmers , like me.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 ปีที่แล้ว

      Very happy to hear that Paul! Thank you for watching and taking the time to leave a comment, it's much appreciated!

  • @AamirSaeedTajalli
    @AamirSaeedTajalli 3 ปีที่แล้ว +1

    Vdo is very precise, to the point and designed keeping in mind FAQs.. You answered all the question that poped out in my mind. Well done and thanks a lot.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 ปีที่แล้ว +1

      Thanks Aamir, happy to hear that you found this one useful! Thanks for watching and leaving a comment!

    • @AamirSaeedTajalli
      @AamirSaeedTajalli 3 ปีที่แล้ว

      My friend.. no buttering at all... but your all videos are truly helping me and many more like me.. GREAT STUFF. Thanks for your efforts and openness to share your knowledge and experience. May the almighty ALLAH bless you and your family.

  • @grantgatland692
    @grantgatland692 3 ปีที่แล้ว +1

    Excellent - I like the explanations of why each element is added/needed in a string of commands (helps to avoid guesswork on syntax)

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 ปีที่แล้ว

      Thanks Grant, happy to hear you found it useful!

  • @donbogdala5428
    @donbogdala5428 7 ปีที่แล้ว +1

    Andrew, what would I do without you! Your timing couldn't have been more perfect! I am currently working on a personal project involving shapes. This has given me some ideas on where to start.

  • @songokussj4cz
    @songokussj4cz 7 ปีที่แล้ว

    You just covered what is my assignment at work. (Creating Gantt diagram with bars as shapes).
    And you blow my mind that range(A1:A3) has .width, .height methods. :-) I was calculating this by substracting the left cell from right cell + 1 values.
    Thanks for that! You're awesome.

  • @falstaff0808
    @falstaff0808 7 ปีที่แล้ว

    I've been struggling with control over some section header graphics in an automated Word document, using the .Shapes controls. Once I saw this video title in the playlist, I skipped past all those Chart (booooring!) ones to get straight to these sweet nuggets of instruction. I am looking forward to improving my codez with your sublime wisdom!

  • @saeedlawaf2809
    @saeedlawaf2809 ปีที่แล้ว +1

    thank you so much for this complete course. it is really useful. 🌹💖🙏

    • @WiseOwlTutorials
      @WiseOwlTutorials  ปีที่แล้ว

      You're very welcome Saeed, thanks for watching!

  • @vadims9554
    @vadims9554 6 ปีที่แล้ว

    Hello Andrew - I wanted to say thank you for your excel vba video tutorials. I have been watching it for past year or so and I found them to be clear and very informative. Many thanks!

  • @ThuhOthers
    @ThuhOthers 3 ปีที่แล้ว +1

    This is exactly what I was looking for. Thank you so much!!!

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 ปีที่แล้ว +1

      You're welcome, glad you found it useful and thanks for watching!

  • @numchuck180
    @numchuck180 2 ปีที่แล้ว

    Fantastic! this is really helpful series of videos! something i'm having trouble finding information for is dealing with shapes in groups, specifically how to reference child shapes and parent shapes

    • @WiseOwlTutorials
      @WiseOwlTutorials  2 ปีที่แล้ว

      Hi! You might find this useful docs.microsoft.com/en-us/office/vba/api/excel.groupshapes
      I hope it helps!

  • @davidjones5319
    @davidjones5319 2 ปีที่แล้ว +1

    Excellent. Thank you

    • @WiseOwlTutorials
      @WiseOwlTutorials  2 ปีที่แล้ว

      You're welcome David, thanks for watching!

  • @tajsay
    @tajsay 4 ปีที่แล้ว

    this is so great tutorials...i am loving it.........thank Andrew and WiseOwal team for your efforts

  • @sasavienne
    @sasavienne 4 ปีที่แล้ว +1

    Thank you so much for sharing this video. 💯 Likes

  • @krn14242
    @krn14242 7 ปีที่แล้ว

    Very useful video Andrew. Thank-you Sir.

  • @ardeshiraqayi9976
    @ardeshiraqayi9976 3 ปีที่แล้ว

    Thanks a lot for the video. Could you please teach me how can we control the space among the shapes and put gap between them, both horizontally and vertically ? Thanks again

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 ปีที่แล้ว

      Hi Ardeshir! I think you will find this video helpful th-cam.com/video/Rm--XZ0ZvNE/w-d-xo.html It shows how to position pictures on a worksheet in rows and columns. I hope it helps!

  • @ashutoshw220
    @ashutoshw220 4 ปีที่แล้ว

    Great teaching!!!

  • @MegaWatchutube
    @MegaWatchutube 5 ปีที่แล้ว +2

    This is so great, thanks.

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 ปีที่แล้ว

      You're welcome Orlando, thank you for watching!

  • @vishnupriyan5769
    @vishnupriyan5769 หลายเดือนก่อน

    Hi sir... Ur videos are awsome thanks...
    How to read the text from shapes ..?
    Can u pls explain...

  • @gauravjain5159
    @gauravjain5159 3 ปีที่แล้ว +1

    Good Morning Andrew!! Hope you are well. I was looking for any ActiveX Control tool to display graph on the Form. Is there any such tool available or do we hv to use image tool to generate graph in Excel sheet and import over Form ? If you have any video for similar topic pls redirect thanks a million again!!

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 ปีที่แล้ว +1

      Hi Gaurav! I'm well thank you, I hope you are too! There used to be a chart tool which you could add to a VBA user form but I think that this was part of the common controls library which is no longer distributed with Excel. It looks like the best option is described here stackoverflow.com/questions/31598704/displaying-live-chart-data-in-excel-userform
      I'm sorry but we don't have a video on that topic but I'll add this to the to do list!

    • @gauravjain5159
      @gauravjain5159 3 ปีที่แล้ว +1

      Thanks a million Andrew once again :) Your responses are always helpful.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 ปีที่แล้ว

      @@gauravjain5159 You're very welcome Gaurav!

  • @augustodemelo915
    @augustodemelo915 4 ปีที่แล้ว

    Great tutorial!!!!

  • @jeethendraprabhu8707
    @jeethendraprabhu8707 8 หลายเดือนก่อน

    Hi I have data in which I have column A with small shapes (Red, Green & Yellow). And I have to update Column B with color names (Green, Red & yellow). how can I do it? I can select all the shapes through VBA, but I cannot loop through the shapes. please help.. thanks in advance.

  • @bharatisgreate
    @bharatisgreate 4 ปีที่แล้ว

    fantastic tutorial...thank you so much!!

  • @pikachubr007
    @pikachubr007 2 ปีที่แล้ว

    thanks for your video. but i want to draw 1 straingth line in 01 range (ex: A1) How to do it. could u help me. pls. thanks

    • @WiseOwlTutorials
      @WiseOwlTutorials  2 ปีที่แล้ว

      Hi Dan! Did you check out the part of the video which explains "Positioning Relative to a Range"? You can combine these techniques with the Shapes.AddLine method docs.microsoft.com/en-us/office/vba/api/excel.shapes.addline
      I've made an answer video to explain how this works th-cam.com/video/WQy8I6RKuOI/w-d-xo.html It's only available to channel members with the early access perk at the moment!

  • @mridulbhattarai5808
    @mridulbhattarai5808 2 ปีที่แล้ว

    I want to change the size of a shape according to the value entered in the cell. How can I do that?

    • @WiseOwlTutorials
      @WiseOwlTutorials  2 ปีที่แล้ว

      The basic version looks like this:
      Dim sh As Shape

      Set sh = Sheet1.Shapes(1)

      sh.Width = Range("A1").Value

  • @MarekLS60
    @MarekLS60 4 ปีที่แล้ว

    Great video

  • @mihaibr206da
    @mihaibr206da 9 หลายเดือนก่อน

    HI.can i add a shape in userform1/frame1/listbox1 ?

    • @WiseOwlTutorials
      @WiseOwlTutorials  9 หลายเดือนก่อน

      Hi! No, you can't draw shapes on a userform in the same way. You could use the Image control to insert a picture of a shape but it's a different technique to the one shown here.

  • @LarsIngeHolen
    @LarsIngeHolen 5 ปีที่แล้ว

    Do you have an tutorial where you can do all this (insert shape, resize shape, recolor shape and add text) using for form controls? It WOULD be VERY VERY helpful!!!

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 ปีที่แล้ว

      Hi Lars,
      We don’t have a video which covers how to control shapes using form controls but this older video does explain how to assign subroutines to form control buttons www.wiseowl.co.uk/vba-macros/videos/vba-basics/buttons-toolbars-shortcuts/
      I hope that helps!

  • @nishantkumar9570
    @nishantkumar9570 7 ปีที่แล้ว

    Thank you very much. Video is really very helpful.
    Is there any way to add a floating shape in excel?

    • @nishantkumar9570
      @nishantkumar9570 7 ปีที่แล้ว

      Well, by floating shape i mean when i scroll the worksheet down, shapes also scroll with it so that the button assigned to shape is always available for click no matter how down in the worksheet i go.
      Thank you for your reply.

    • @nishantkumar9570
      @nishantkumar9570 7 ปีที่แล้ว

      Thank You very much.

  • @carlosrodriguez0112
    @carlosrodriguez0112 4 ปีที่แล้ว

    thank, that is so great tutorial

  • @mohamedabdelrahman169
    @mohamedabdelrahman169 6 ปีที่แล้ว

    Thanks for the video , you are amazing.. I am working on excel sheet which contains images and pictures and I want to l to know the location "Rows, Columns" for each shape... can you help

  • @kakimotoK20
    @kakimotoK20 5 ปีที่แล้ว

    Hi Andrew, I haven't watched this yet, but have a problem regarding shapes. I have about 20 toggle buttons that I want to replace with 3D shapes. The toggles are tied together, so that only one can be selected at a time and I'm not sure how to do this with a shape because they don't have a True False status. My toggle code is:
    ...
    .Range(.Columns("h"), .Columns("r")).Hidden = ToggleButton1.Value
    End With
    Next
    If Me.ToggleButton1.Value = True Then Exit Sub
    Me.ToggleButton2.Value = True
    Me.ToggleButton3.Value = True
    ...
    End with
    End Sub
    I'm a total noob in VBA. Can you help, or tell me which video of yours covers how I can get shapes to act as toggles while only have one selected at a time?

  • @forzaalgiers2045
    @forzaalgiers2045 7 ปีที่แล้ว

    Great video , thank you !!

  • @jayjayf9699
    @jayjayf9699 5 ปีที่แล้ว

    I have shapes in my active sheet , I do debug.print shapes(1).name and it doesn’t work , how come when I do debug.print worksheets(1).name that works but it doesn’t work for the shapes collection? Also I’ve checked the object browser for these collection and both don’t have a name property in the member of the object .

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 ปีที่แล้ว

      Hi there,
      The Shapes property doesn't have an implicit scope so you need to qualify the reference to it by referring to an object which has a Shapes property (such as a worksheet or a chart), e.g. Worksheets("Sheet1").Shapes(1).Name
      The Worksheets property has an implicit scope and so you don't need to qualify it, although you can if you like, e.g. Workbooks("Book1.xlsx").Worksheets("Sheet1")
      The Shapes property returns a reference to an object of the Shape class and, similiarly, the Worksheets property returns a reference to an object of the Worksheet class. In the Object Browser, look for the Shape and Worksheet classes rather than the Shapes and Worksheets classes to see the correct list of methods and properties.
      I hope that helps!

    • @jayjayf9699
      @jayjayf9699 5 ปีที่แล้ว +1

      @@WiseOwlTutorials thanks, your tutorial saved my life learning vba, especially as the management didn't offer me training

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 ปีที่แล้ว

      Cheers Jay, happy to hear that it helped!

  • @satishkumarkrishnamurthy2581
    @satishkumarkrishnamurthy2581 2 ปีที่แล้ว

    how to know the index no. of a particular shape?

    • @WiseOwlTutorials
      @WiseOwlTutorials  2 ปีที่แล้ว

      I don't think that there's a property to return this (shapes do have an ID property but this doesn't correspond to the index number). The easiest thing to do is loop through the shapes collection to identify each shape by index and name like so
      Dim i As Integer

      For i = 1 To ActiveSheet.Shapes.Count
      Debug.Print i, ActiveSheet.Shapes(i).Name
      Next i

  • @iceiceisaac
    @iceiceisaac 3 ปีที่แล้ว

    how can i add shapes into the cell itself tho?

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 ปีที่แล้ว +1

      Hi! You can't insert drawing objects into a cell (although you can align objects to cells using the Left and Top properties). Do you mean emojis or wingding style shapes? If so, there's some useful code shown on this post stackoverflow.com/questions/55195005/can-anyone-explain-how-to-insert-emojis-to-vba-excel
      I hope it helps!

  • @justusvermehren9198
    @justusvermehren9198 5 ปีที่แล้ว

    Hey Andrew, nice video.
    But how can you change the texts in the different fields of the smart art per VBA? :o

  • @باليتركي
    @باليتركي 7 ปีที่แล้ว

    thanks

  • @lovestreaming
    @lovestreaming 7 ปีที่แล้ว

    Great help, as usual. Thanks a lot! :)

  • @jayjayf9699
    @jayjayf9699 5 ปีที่แล้ว

    Hi I am tearing my hair out over the hangman loop vba problem on your website can you give me advice for please ?

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 ปีที่แล้ว

      :D if it makes you feel better that's the most difficult exercise we give out on our Introduction to Excel VBA course! How far did you get? If you can post some of your code here I might be able to point you in the right direction without giving the full answer!

    • @jayjayf9699
      @jayjayf9699 5 ปีที่แล้ว

      @@WiseOwlTutorials I think I've done most of it, have u got an email, so I can send you code?

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 ปีที่แล้ว +1

      Jay I'd love to be able to respond personally by email to every request for help but sadly if I did that I wouldn't have time for anything else. You're welcome to post some code here and I can try to give you a few hints.

    • @jayjayf9699
      @jayjayf9699 5 ปีที่แล้ว

      @@WiseOwlTutorials
      Option Explicit
      Sub hangman()
      Dim sh As Shape
      Dim guess As String
      Dim hello As Boolean
      Dim wordcell As Range
      Dim guessletter As String
      Dim correctguess As Boolean
      Dim blackfont As Boolean
      Dim shapecount As Double
      ' restart game clear all the shapes and values
      For Each sh In Worksheets("Game").shapes
      sh.Visible = msoFalse
      Next sh

      ' Worksheets("Game").Range(Cells(1, 2), Cells(1, 20)).Delete
      ' Worksheets("Game").Range(Cells(1, 2), Cells(1, 20)).Font.Color = vbWhite

      Application.ScreenUpdating = True
      shapecount = 0
      If Range("B1").Value = "" Then
      MsgBox "Please enter the word to be guessed and restart macro."
      Exit Sub
      End If
      Do While notvisiable = True
      correctguess = False
      guessletter = InputBox("Please enter your guess letter")
      For Each wordcell In Range(Cells(1, 2), Cells(1, Range("A1").End(xlToRight).Column))

      If wordcell.Value = guessletter Then
      wordcell.Font.Color = vbBlack
      correctguess = True
      End If
      Next wordcell
      'blackfont = False
      'For Each wordcell In Range(Cells(1, 2), Cells(2, Range("B1").End(xlToRight).Column))

      'If wordcell.Font.Color = vbBlack Then
      ' blackfont = True
      'End If



      If correctguess = False Then
      shapecount = shapecount + 1
      Worksheets("Game").shapes(shapecount).Visible = msoTrue

      End If



      'Next wordcell
      If guessed = True Then
      MsgBox " you won!!!"
      Exit Sub
      End If






      Loop
      'For Each sh In Worksheets("Game").shapes
      ' sh.Visible = msoTrue
      'Next sh
      End Sub
      Function notvisiable() As Boolean
      notvisiable = False

      Dim sh As Shape

      For Each sh In Worksheets("Game").shapes
      If sh.Visible = msoFalse Then
      notvisiable = True
      End If
      Next sh
      End Function
      Function guessed() As Boolean
      Dim wordhasbeenguessed As Boolean
      Dim lengthofword As Double
      Dim wordnumb As Range
      Dim count As Integer
      count = 0
      wordhasbeenguessed = True
      For Each wordnumb In Range(Cells(1, 2), Cells(1, Range("A1").End(xlToRight).Column))
      If wordnumb.Font.Color = vbWhite Then
      wordhasbeenguessed = False
      End If
      count = count + 1
      Next wordnumb

      guessed = wordhasbeenguessed

      lengthofword = count



      End Function

    • @jayjayf9699
      @jayjayf9699 5 ปีที่แล้ว

      @@WiseOwlTutorials what do you think of my hangman solution?

  • @redhaakhund1271
    @redhaakhund1271 10 หลายเดือนก่อน +1

    🙏👍👍👍👍👍