excel

Im looking for Excel VBA code to automatically duplicate Tab 1 in workbook when a table in Tab 2 is populated with a name

喜你入骨 提交于 2021-01-29 09:02:40
问题 VBA code needed: I have 2 tabs in a workbook. Tab 1 (DIST "A") is a formatted spreadsheet & Tab 2 (RFP) has a table with a column called "Distributor". When I enter names under the Distributor list, could be 1 or 30 differnet names, I want VBA to automatically duplicate Tab 1, rename the duplicated sheet to whatever name I entered, and send it to end of workbook. Here's my current code, its duplicating the ACTIVE SHEET, Tab 2 and not Tab 1 (what I need) Sub Copyrenameworksheet() Dim ws As

Alternative to Access Printer object in Excel VBA

两盒软妹~` 提交于 2021-01-29 09:01:12
问题 I am trying to send raw data (ZPL) to a selected printer in Excel VBA. I have done this successfully in different Ms Access projects, but now I need the same functionality in an Excel project. I am able to use the same code by referencing the Access object library in my Excel VBA project and it works as expected. The problem is that the workbook can later be used on computers without Access installed, and I can't find the alternative objects. Private Type DocInfo pDocName As String

Select 6 items while maximizing values under constraints [closed]

旧巷老猫 提交于 2021-01-29 08:59:52
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 months ago . Improve this question I have numerous data points of items of which have a predetermined price-tag associated with them as well as a self calculated return value of each item. I'm looking to select 6 of the 100+ items in order to maximize the total return value while keeping the

Error downloading and reading Excel file from URL in R [duplicate]

假如想象 提交于 2021-01-29 08:59:30
问题 This question already has answers here : Downloading Excel File Using R (3 answers) Closed 2 years ago . The following code library(readxl) url <- "http://www.econ.yale.edu/~shiller/data/ie_data.xls" destfile <- "ie_data.xls" download.file(url, destfile) ie_data <- read_xls(destfile, sheet="Data", skip = 7) produces Error in sheets_fun(path) : Failed to open ie_data.xls One thing that perplexes me is that if goto the URL and download the file manually I can use read_xls to open it. I think

Validating textbox entry on Userform (Excel VBA)

旧城冷巷雨未停 提交于 2021-01-29 08:56:28
问题 I have a textbox (in this instance it is textbox11) where the front end user will need to input "Half Day" in some form or another. Here is my code: Private Sub TextBox11_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) If Me.TextBox11 = "half" Or Me.TextBox11 = "half day" Or Me.TextBox11 = "half-day" Or Me.TextBox11 = 0.5 Or Me.TextBox11 = "1/2" Then Me.TextBox11 = "Half Day" End If End Sub When I run it, it works wonderfully - for the conditions I have set. However, if a user, say,

Can't properly close Excel application

北城余情 提交于 2021-01-29 08:53:18
问题 i am very new to VB.net and i'm trying to proceed step by step with my application. The application i'm trying to build will collect a series of macros i've written in Excel VBA environment. Now, the following code pasted below, is the initial part, where basically i try to load a workbook (to be used as Active workbook) and to "unload it". The issue comes when, after "unloading" the workbook, i try to open the very same workbook in excel. Excel application return an error that is "Open in

Add variable to Select-Object command in powershell and output to excel csv

懵懂的女人 提交于 2021-01-29 08:52:09
问题 I have a script that fetch user's manager info from a text file containing its respective groups and I want to put the results in an excel spreadsheet. Also, I'd like to add a custom variable to the Select-Objects command so it shows up as another column in excel with each user's respective group Here is what I have so far: $Properties = @( 'Title', 'Department', 'Manager' ) [string[]]$arrayFromFile = Get-Content -Path 'C:\sslvpn-active.txt' foreach($group in $arrayFromFile){ $searchb = "CN="

“Invalid Procedure Call or Argument” when using Application.Match within VBA Function

Deadly 提交于 2021-01-29 08:51:07
问题 This is my function: Function stageValueVariance(stage As String, valCol As Long) For i = 2 To offlineHeight If Application.VLookup(offline.ListColumns(1).Range(i).value, bce.DataBodyRange, valCol, 0) <> offline.ListColumns(valCol).Range(i).value Then foundID = Application.WorksheetFunction.Match(offline.ListColumns(1).Range(i), oldOut.ListColumns(1).DataBodyRange, 0) If foundID = 0 Then foundID = Application.WorksheetFunction.Match(offline.ListColumns(1).Range(i), valComp.ListColumns(1)

Press on link inside table with vba on webpage

﹥>﹥吖頭↗ 提交于 2021-01-29 08:42:19
问题 I figured out how to navigate to the webpage and make it search for my specific input and so fourth. However when i get the list with the result i am not able to make vba click on it. I have tried different variations of: objIE.document.getElementById("isc_ListGrid_1_body$28s").Click But I'm unable to figure how to press the specifc cell (marked in blue in pic): https://imgur.com/inH25WQ I'm not getting any error's, but its not click on it either. 回答1: You want the id of the table, not the id

Scrape table from website

↘锁芯ラ 提交于 2021-01-29 08:39:36
问题 I have the following code which navigates to a website, enters in two names (used here for example, the real names will pull a list of 10 names from a spreadsheet), then searches for their records. I'm trying to pull the resulting table that is generated into a spreadsheet. I've tried it a few ways but can't seem to get it to work. Looking for code to go under the comment "Scrape Table Here". I know this involves accessing the site's HTML which I can also do but I'm not familiar enough with