excel

Using Excel VBA, how to search for a specific word and insert comments against that word in a Word document?

混江龙づ霸主 提交于 2021-01-29 12:51:58
问题 I am trying to create an excel based tool that reviews Word documents for specific errors. I want this tool to search for a word/sentence and insert a comment against it. I have written a code (please see below) that is able to highlight the word/sentence, however, unable to insert the comment. Here is my code so far: Sub Ref_Figs_Tbls() Dim wdDoc As Object Set wdDoc = ActiveDocument With wdDoc With .Range With .Find .ClearFormatting .Replacement.ClearFormatting .MatchWildcards = True .Wrap =

How to use MkDir with variable path for different users

淺唱寂寞╮ 提交于 2021-01-29 12:51:54
问题 I have a code where you input information in an excel list. I want to be able to create a folder - I am using the code below. The issue is that I want it to work for all my colleagues (not just me). Can someone please help find where I am getting an error? Note this is a partial code, the error is happening on the MkDir line. Thanks for your help in advance! Dim Startupfolder As String Startupfolder = Startup_Name.Value MkDir Environ$("Userprofile") & "\nc Dropbox\investment oportunities\ &

Excel VBA - Analysing Shared Mailbox Outlook - Run time error 1004: Application-defined or object-defined error

穿精又带淫゛_ 提交于 2021-01-29 12:47:05
问题 I am using the following code in Excel to try to get the details from our shared mailbox into a spreadsheet for further analysis. The code produces a run-time error 1004: application-defined or object-defined error at the point it reaches trying to get the Sender, SenderEmailAddress & SenderName. It is fine when these parts are made inactive and it gets the Subject, ReceivedTime, etc without any issue. Does anyone know what needs to be changed to get that working? Also, does anyone have any

Colour all rows with the same colour until value of a cell is not the same as in the previous row anymore

扶醉桌前 提交于 2021-01-29 12:44:08
问题 I have the below Excel-table: | A | B ---------|-----------|--------------- 1 | 500 | 2 | 500 | 3 | 500 | ---------|-----------|---------------- 4 | 600 | 5 | 600 | ---------------------|---------------- 6 | 300 | ---------------------|---------------- 7 | 800 | 8 | 800 | 9 | 800 | ---------------------|---------------- 10 | 200 | 11 | 200 | ---------------------|---------------- 12 | 900 | ---------------------|---------------- 13 | 100 | 14 | 100 | In Column A there a different numbers

Webscrap VBA - List

不羁的心 提交于 2021-01-29 12:39:39
问题 I am trying to set up a webscrapping VBA code to import data into Excel from this website: https://www.thewindpower.net/windfarms_list_en.php I wish to launch this webpage, select a country and then scrap the data from the table below (including url from the name column). Yet, I am stuck with several points: How can I select the country I wish in VBA code ? How can I select the table as there is no id or class in the tag ? How can I import the URL included in the name column ? Here is the

Power Query, keep output table same size while refreshing

风格不统一 提交于 2021-01-29 12:32:26
问题 I'm using this code to filter some text out of a .txt file. Then in another sheet i use cell references to built my custom table. Everything is working great, except if the source file is empty, Power Query resizes the output table so that the reference got broken in the second sheet. =cellref!$C4 how can I prevent power query to resize the range in his table? or, somehow, keep the same number of rows/column so that it won't break my references? let Source = Table.FromColumns({Lines

Excel Formula to find a specific number

巧了我就是萌 提交于 2021-01-29 12:24:14
问题 A newbie here, can someone help me to figure it out. I have the follwoing data in Excel: Column A: T1 T2 T3 2T1 3T2 1T3 I want to return how often T1 occurs in column A.. T1 in column A should be 3 (T1 + 2T1) Does someone know how to solve this problem? 回答1: Possibly multiple ways, one way would be: Formula in C2 : =SUM(IF(MID(A$1:A$6,SEARCH("T",A$1:A$6),LEN(A$1:A$6))=B2,IFERROR(LEFT(A$1:A$6,SEARCH("T",A$1:A$6)-1)*1,1),0)) Note: Confirm through Ctrl Shift Enter 来源: https://stackoverflow.com

Formating programmatically Excel cells from Scientific numeric to Text with C#

北城余情 提交于 2021-01-29 12:20:50
问题 I'm facing a problem after extracting data from my sqlServer dataBase to my Excel worksheet using Microsoft.Office.Interop.Excel reference. Numeric data are displayed in a scientific numeric format, instead of being displayed in a text format. I tried to format my cell this way, but still doesn't work : Microsoft.Office.Interop.Excel.Range cell= (Range) worksheet.Cells[rowNum, fieldNum]; cell.NumberFormat="@"; I tried even to set my cells format in my Input Excel file; which i'm actually

Excel live data counter (DDE Server)

▼魔方 西西 提交于 2021-01-29 12:14:46
问题 I'm using DDE server to import live data on excel on two columns, the data changes every second. What im currently doing is i have live data on Cell A1 and live data on Cell B1 on Cell C1 i have the following formula =A1=B1 Which is suppose to be true, but sometimes the result is false (as cell A1 doesn't match cell B1) I want to calculate how many times "false" is the result in C1 My problem is its a live data and changes almost every second, and my result should be accumulated. Does anyone

VBA Macro cannot find folder path

二次信任 提交于 2021-01-29 12:12:20
问题 I have written a macro (with the help of several internet sources) that will iterate through files in a SharePoint folder online and extract the needed info out of said folder, then move onto the next. However, it does not seem to locate the folder path and produces an error telling me it cannot locate folder path. I have checked the path by copying and pasting the folder into google chrome and it works. I'm sure this will be a silly and stupid fix but i cannot seem to get it to work. Sub