VBA USERFORM SCREEN SIZE
I tried to fit the vba userform with laptop screen size.But it is not coming properly.Kindly Suggest
See also questions close to this topic
Array with references for a pathway to open file
I tried the following code in order to avoid writing too much lines (since the list is long - over 134), but got error in the line which tries to open the file.
Here is an idea of the code:
Sub update_chemicals() 'update chemical database with macroeconomic indicators 'Dim local_main As String Dim mylocal As Variant Dim local_final As String Dim myname As Variant Dim name_final As String 'disrectories references Dim local_1 As String Dim local_2 As String Dim local_3 As String Dim local_4 As String Dim local_5 As String 'Files Dim name_1 As String Dim name_2 As String Dim name_3 As String Dim name_4 As String Dim name_5 As String 'Coal local_1 = "G:\path\01. CARVAO\Carvao.V1.xlsm" name_1 = "Carvao.V1.xlsm" 'Perlita local_2 = "G:\path\Perlita.xlsm" name_2 = "Perlita.xlsm" 'Diatomaceus Earth local_3 = "G:\path\Terra_Diatomacea.xlsm" name_3 = "Terra_Diatomacea.xlsm" 'Chloridric Acid local_4 = "G:\path\Chloridric_Acid_v2.xlsm" name_4 = "Chloridric_Acid_v2.xlsm" 'Hexane and Gasoline local_5 = "G:\path\Price History - Hexane and Gasoline - PLATTS - Jan'17.xlsm" name_5 = "Price History - Hexane and Gasoline - PLATTS - Jan'17.xlsm" mylocal = Array("local_1", "local_2", "local_3", "local_4", "local_5") myname = Array("name_1", "name_2", "name_3", "name_4", "name_5") '/////////////////////////////////////////////// COAL \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ For x = 0 To 4 local_final = mylocal(x) name_final = myname(x) Workbooks.Open filename:=local_final
The error appears when I try to open the file
Could you help me out?
How to make a random number generate in a new cell
So I want to generate random numbers between 1-13. I have a random number generate Cell A1 but I want to offset a row to put a random number in cell A2 and so forth.
Here is my work so far:
Sub randomnumb() Dim random_number As Integer Randomize random_number = Int(13 * Rnd) + 1 Cells(1, 1) = random_number End Sub
After being able to do that. I want the random numbers to stop generating after 10 times. I think the "Do Until" method will work but not sure how to do it.
So after playing with it I figured out how to make the next cell generate a random number. I now want to make it where columns B and C generate random numbers starting from Cells B2 and C2. Here is my work so far:
Sub randomnumb() Dim IntCardOne As Integer Randomize IntCardOne = Int(13 * Rnd) + 1 ActiveCell.Value = IntCardOne ActiveCell.Offset(1, 0).Select
VBA Excel get first line data from website table
I am using VBA Excel to crawl some data from the internet. The link is :
I would like to extract these line, with each element in a different cell:
Jack Morris, L (0-1) 6.2 7 5 2 3 3 0 2.7 31 95 52 31 7 14 8 17 5 0 46 -0.252 0.62 -2.1
Set objIE = CreateObject("InternetExplorer.Application") objIE.Top = 0 objIE.Left = 0 objIE.Width = 800 objIE.Height = 600 objIE.Visible = True objIE.Navigate ("http://www.baseball-reference.com/boxes/BOS/BOS199004090.shtml") Do DoEvents If Err.Number <> 0 Then objIE.Quit Set objIE = Nothing GoTo j: End If Loop Until objIE.ReadyState = 4 item = objIE.Document.getElementsByClassName("suppress_csv sortable stats_table now_sortable")(0).getElementsByTagName("td")(0)
I tried different combinations to extract my item but nothing seems to work. Thank you in advance.