excel

Extract table from webpage using VBA

家住魔仙堡 提交于 2021-02-10 15:02:13
问题 I would like to extract the table from html code into Excel using VBA. I have tried the following code several times with changing some of the code but keep on getting error. Sub GrabTable() 'dimension (set aside memory for) our variables Dim objIE As InternetExplorer Dim ele As Object Dim y As Integer 'start a new browser instance Set objIE = New InternetExplorer 'make browser visible objIE.Visible = False 'navigate to page with needed data objIE.navigate "http://www.bursamalaysia.com/market

Setting RowHeight Excel VBA

限于喜欢 提交于 2021-02-10 14:49:01
问题 I've been struggling for several hours to set row heights for an implied range. The code works except for two problems 1. ALL rows with data are set to AutoFit instead of just the intended range and 2. I cannot seem to add '3' to the row height per the 2nd to last line of code: Sub SetRH() ActiveSheet.Unprotect Application.ScreenUpdating = False Range("C" & (ActiveCell.row)).Select Range(Selection, Selection.End(xlDown)).Select Range(Selection.Offset(0, 0), Selection.Offset(0, 4)).Select

Setting RowHeight Excel VBA

☆樱花仙子☆ 提交于 2021-02-10 14:46:31
问题 I've been struggling for several hours to set row heights for an implied range. The code works except for two problems 1. ALL rows with data are set to AutoFit instead of just the intended range and 2. I cannot seem to add '3' to the row height per the 2nd to last line of code: Sub SetRH() ActiveSheet.Unprotect Application.ScreenUpdating = False Range("C" & (ActiveCell.row)).Select Range(Selection, Selection.End(xlDown)).Select Range(Selection.Offset(0, 0), Selection.Offset(0, 4)).Select

Aggregate function (small) returns zeros rather than the smallest values

微笑、不失礼 提交于 2021-02-10 14:42:34
问题 I am using excel's aggregate (small) function to find the smallest value for each name that appears in a column. The issue is that the formula below simply returns 0s everywhere there is a value in B. The formula I am using is =IF($B2<>"", AGGREGATE(15,7, ($B:$B)*($A2=$A:$A)*($B2<>""), 1), "") where B contains the data I want the smallest value from and A contains identifying strings. I appreciate any help you can lend! 回答1: You want to divide by the criteria: =IF($B2<>"", AGGREGATE(15,7, ($B

Excel Power Query. Different Formulas for Each Row of Values from Other Rows

时间秒杀一切 提交于 2021-02-10 14:41:00
问题 I have a table 1 of 500+ rows that are updated multiple times during a month by a request. And there is a updated table of different formulas (200+) that should be calculated using values from table 1. Table 1 year product value 1993 Apple 98.45 1994 Mushrooms 67.54 1992 Apple 95.45 2021 Melon 112.0 Table 2 id formula 1 1994/1993*100-100 2 1994-1993 3 2021/1992*100-100 etc... My way: in table_1 I have created a key column - year. I have modified the formula (below - a pic): Code for table_2:

Aggregate function (small) returns zeros rather than the smallest values

耗尽温柔 提交于 2021-02-10 14:37:15
问题 I am using excel's aggregate (small) function to find the smallest value for each name that appears in a column. The issue is that the formula below simply returns 0s everywhere there is a value in B. The formula I am using is =IF($B2<>"", AGGREGATE(15,7, ($B:$B)*($A2=$A:$A)*($B2<>""), 1), "") where B contains the data I want the smallest value from and A contains identifying strings. I appreciate any help you can lend! 回答1: You want to divide by the criteria: =IF($B2<>"", AGGREGATE(15,7, ($B

Excel Power Query. Different Formulas for Each Row of Values from Other Rows

落爺英雄遲暮 提交于 2021-02-10 14:37:14
问题 I have a table 1 of 500+ rows that are updated multiple times during a month by a request. And there is a updated table of different formulas (200+) that should be calculated using values from table 1. Table 1 year product value 1993 Apple 98.45 1994 Mushrooms 67.54 1992 Apple 95.45 2021 Melon 112.0 Table 2 id formula 1 1994/1993*100-100 2 1994-1993 3 2021/1992*100-100 etc... My way: in table_1 I have created a key column - year. I have modified the formula (below - a pic): Code for table_2:

Sending an Email from Excel when Outlook not available using VBA

倾然丶 夕夏残阳落幕 提交于 2021-02-10 14:33:39
问题 I want to send stakeholders an e-mail when a subordinate makes any updates in the Excel worksheet. I hope to use a Workbook_BeforeSave event where an e-mail is triggered from the subordinate's Outlook account. The subordinate/user needs Outlook configured/installed in their system. If not mail wont be triggered. Is there any way to overcome this, like sending the mail triggering request to a remote computer/server where Outlook is preconfigured and sending the mail from that computer/server

How do you underline, bold and italicized certain portions of text within a range for each cell?

泪湿孤枕 提交于 2021-02-10 14:33:27
问题 I am trying to underline, bold and italicized certain portions of text within a cell. My first line of text starts at line 2, where I am trying to bold the second and third line of this cell. The last part of line 2, I am trying to italicized this. Line 5 needs to be underlined. I have a list of these that I am trying to go through, so I started with a 'for loop'. I can get the first two lines to be bold, but I have trouble getting the italic and underline portion right. Here's what I'm

How to compare numerical values to categorical ranges in column headers in pandas?

被刻印的时光 ゝ 提交于 2021-02-10 14:32:20
问题 I have one dataframe that looks like this: import pandas as pd import datetime df1 = pd.DataFrame.from_dict( {'Unnamed: 4': {0: 'Values'}, datetime.datetime(2021, 1, 1, 0, 0): {0: 8}, datetime.datetime(2021, 1, 2, 0, 0): {0: 12}, datetime.datetime(2021, 1, 3, 0, 0): {0: 99}, datetime.datetime(2021, 1, 4, 0, 0): {0: 25}, datetime.datetime(2021, 1, 5, 0, 0): {0: 35}} ) and a second dataframe that looks like this df2 = pd.DataFrame.from_dict( {'Level': {0: 'Range', 1: 'Middle point', 2: 'Total