vba

Adding hyperlink to dynamically created label in VBA Excel

百般思念 提交于 2021-02-11 06:30:57
问题 I have multiple labels created dynamically on Userform. I want to add a hyperlink to the created labels, is there a way I could add hyperlink to these labels. Here is the code of how I created the labels dynamically. Private Sub cmdViewReports_Click() Dim row_num As Long Dim fso As Object Dim src_path As String Dim dest_path As String Dim sub_folder As String Dim theLabel1 As msforms.Label Dim inc As Integer Dim my_files As Object Dim my_folder As Object Dim i As Integer Dim ctrl As Control

Excel VBA Web Scraping Returning Wrong Text in MSXML2.XMLHTTP method

∥☆過路亽.° 提交于 2021-02-11 06:29:38
问题 I am trying to extract the movie description from this Url, "https://ssl.ofdb.de/plot/138627,271359,I-Am-Legend" When i use CreateObject("InternetExplorer.Application") method it gives me the correct web string as visually seen in the web site (This method is slow) But if i use the MSXML2.XMLHTTP,some of the text returned or non readable text (But this method is fast) Output of First Method:(No problem) Robert Neville (Will Smith) war ein hervorragender Wissenschaftler, aber auch er konnte

Excel VBA Web Scraping Returning Wrong Text in MSXML2.XMLHTTP method

做~自己de王妃 提交于 2021-02-11 06:29:36
问题 I am trying to extract the movie description from this Url, "https://ssl.ofdb.de/plot/138627,271359,I-Am-Legend" When i use CreateObject("InternetExplorer.Application") method it gives me the correct web string as visually seen in the web site (This method is slow) But if i use the MSXML2.XMLHTTP,some of the text returned or non readable text (But this method is fast) Output of First Method:(No problem) Robert Neville (Will Smith) war ein hervorragender Wissenschaftler, aber auch er konnte

Create table in Word Document From Access using VBA

泪湿孤枕 提交于 2021-02-11 03:35:34
问题 I am trying to create tables in a Word document template from my Access database. This bit of code runs fine from Word itself and creates tables as required. I was wondering if its possible to run this code from Access and point to a specific word document in which to create the tables. Dim numberOfTables As Integer Dim iCount As Integer numberOfTables = InputBox("How many tables to make?", "Tables") For iCount = 0 To numberOfTables - 1 ActiveDocument.Tables.Add Range:=Selection.Range,

Change a variable value to Proper Case in VBA?

廉价感情. 提交于 2021-02-11 02:52:21
问题 I have a textbox, traditionally labeled as TextBox1, my TextBox1 accepts only Uppercase input (for names), but i'm using the same text to save the file in a folder, when i save i want the name of the person to be in Title case isntead, but I cant figure out how. Here is what i got so far (i dont know how to use strings, so pardon if there is some werid mistake): Private Sub CommandButton1_Click() Dim title As String title = TextBox1.Value Console.WriteLine (StrConv(title, VbStrConv.ProperCase

Change a variable value to Proper Case in VBA?

随声附和 提交于 2021-02-11 02:49:41
问题 I have a textbox, traditionally labeled as TextBox1, my TextBox1 accepts only Uppercase input (for names), but i'm using the same text to save the file in a folder, when i save i want the name of the person to be in Title case isntead, but I cant figure out how. Here is what i got so far (i dont know how to use strings, so pardon if there is some werid mistake): Private Sub CommandButton1_Click() Dim title As String title = TextBox1.Value Console.WriteLine (StrConv(title, VbStrConv.ProperCase

VBA Excel select & delete all shapes with the same ID and remove

夙愿已清 提交于 2021-02-11 02:49:34
问题 I would like to delete all the shapes from my sheet. They have the same ID. I found two codes: The first one: Public Sub ActiveShapes() Dim ShpObject As Variant If TypeName(Application.Selection) = "Firestop" Then Set ShpObject = Application.Selection ShpObject.Delete Else Exit Sub End If End Sub is not working. There are no errors, but also no reaction at all. The second one: Selecting a shape in Excel with VBA Sub Firestopshapes() ActiveSheet.Shapes("Firestop").Delete End Sub works, but

VBA Excel select & delete all shapes with the same ID and remove

流过昼夜 提交于 2021-02-11 02:46:06
问题 I would like to delete all the shapes from my sheet. They have the same ID. I found two codes: The first one: Public Sub ActiveShapes() Dim ShpObject As Variant If TypeName(Application.Selection) = "Firestop" Then Set ShpObject = Application.Selection ShpObject.Delete Else Exit Sub End If End Sub is not working. There are no errors, but also no reaction at all. The second one: Selecting a shape in Excel with VBA Sub Firestopshapes() ActiveSheet.Shapes("Firestop").Delete End Sub works, but

Excel-VBA Assistance - Data Validation too long, need alternative

回眸只為那壹抹淺笑 提交于 2021-02-11 01:30:37
问题 I know the data validation only lets you place 255 characters. I have named cells/ranges as I have several list I'm trying to pull or select certain information from based on a criteria. My formula is as follows: =IF(AND(RETAILER="",DISPLAY_TYPE=""),"",IF(AND(RETAILER=CODES!$F$2,(OR(DISPLAY_TYPE=CODES!$V$1,DISPLAY_TYPE=CODES!$Y$1))),CODES!$V$2:$V$49,IF(AND(RETAILER=CODE S!$F$2,(OR(DISPLAY_TYPE=CODES!$AB$1,DISPLAY_TYPE=CODES!$AE$1))),CODES!$AB$2:$AB$94,IF(AND(RETAILER=CODES!$F$3,(OR(DISPLA Y

Extracting a specific element from website source code in VBA

眉间皱痕 提交于 2021-02-10 23:39:44
问题 I'm trying to extract a specific link from a website and I'm having trouble pulling into a String. The link to the source code is this: view-source:http://finder.fi/yrityshaku/Nokia+oyj this is the part I'm looking at: <div class="itemName"> <!-- Yritysnimi --> <!-- Aukeaa aina yhteystiedot-vÃ?lilehdelle --> <a href="/Tietoliikennepalveluja%2C+tietoliikennelaitteita/Nokia+Oyj/TAMPERE/yhteystiedot/159838" class="resultGray"> I want to extract the Substring: /Tietoliikennepalveluja%2C