excel-2010

VBA Run-time error '9': Subscript out of range; trying to activate another workbook

允我心安 提交于 2020-01-11 06:18:29
问题 I'm trying to create a VBA in Excel 2010 that takes info from another spreadsheet that I'm not allowed to alter and bring it over to the spreadsheet with my macro built in. Here's my code: Sub BringUpWorkbook() Workbooks("RITE 1624.xls").Activate End Sub I have several VBA books, have visited dozens of sites on the Internet, including those here at stackoverflow.com, and cannot find a reason why I'm receiving the run-time error. The workbook is already open, I've tried adding everything

Excel headers/footers won't change via VBA unless blank

守給你的承諾、 提交于 2020-01-10 03:50:14
问题 Disclaimer: It's been a few years since I worked (a lot) with VBA, so this might be an issue caused by confusing myself with what is essentially a very different language from what I usually deal with. So; I've got a workbook (Excel 2010) with multiple sheets (20+), most of whom are multi-page. To make things easier when printing everything, I want to add some sheet-specific headers with amongst others the name of the sheet, number of pages and so on. I've written a tiny function that should

How to Create a Pivot Table in VBA

自作多情 提交于 2020-01-10 02:08:19
问题 I'm trying to create a Pivot table, but getting Invalid Procedure Call or Argument . ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:="rng", Version:=xlPivotTableVersion14).CreatePivotTable TableDestination:="rngB", TableName:="pvtReportA_B", DefaultVersion:=xlPivotTableVersion14 rng (The source) is a range consisting of about 20 columns and a few thousand rows. rngB (The destination) is a single cell in a different worksheet Can anyone advise where I am going wrong? EDIT

How to Create a Pivot Table in VBA

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-10 02:08:18
问题 I'm trying to create a Pivot table, but getting Invalid Procedure Call or Argument . ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:="rng", Version:=xlPivotTableVersion14).CreatePivotTable TableDestination:="rngB", TableName:="pvtReportA_B", DefaultVersion:=xlPivotTableVersion14 rng (The source) is a range consisting of about 20 columns and a few thousand rows. rngB (The destination) is a single cell in a different worksheet Can anyone advise where I am going wrong? EDIT

Function Similar to importxml in Excel?

守給你的承諾、 提交于 2020-01-09 19:33:07
问题 I love using Google Docs function =importxml() but would love to know if there was anything like it in Excel 2010? I cant seem to find a way for the program to automatically pull data from a linked XML file. For example, I would love to be able to set up a column with the header "Item Name", then have the next column append the user-entered item name in the previous column to this url http://util.eveuniversity.org/xml/itemLookup.php?name= and then parse the resulting XML file to return the

Excel 2010: how to use autocomplete in validation list

扶醉桌前 提交于 2020-01-09 08:54:41
问题 I'm using a large validation list on which a couple of vlookup() functions depend. This list is getting larger and larger. Is there a way to type the first letters of the list item I'm looking for, instead of manually scrolling down the list searching for the item? I've done some Googling but this suggests that this is indeed possible in earlier versions of Excel, but not in Excel 2010. Hope you guys can help. 回答1: Here is a very good way to handle this (found on ozgrid): Let's say your list

Copy a partial row of data from one sheet to a new sheet within the same workbook based on cell content

纵然是瞬间 提交于 2020-01-07 17:51:38
问题 I have scoured the web for a solution to this challenge that I am having, but have not found a suitable solution. I have decent with formulas, but have no experience in VBA or other programming within Excel. I am hoping that one of the many Excel gurus can help me solve this challenge. Sample Sheet https://dl.dropboxusercontent.com/u/95272767/Sample%20Sheet.xlsx The rows of data always begin in row 4 and can extend down to row 1000. I have a sheet of data (Linked Above) that was produced by

VBA Date values when inserted to Excel cells change their format

半腔热情 提交于 2020-01-07 05:29:09
问题 I have date variables formatted like: 25_December_2010 Once i use Dim strDate As String strDate = "25_December_2010" strDate = Replace(strDate,"_"," ") MsgBox strDate Surely enough a MsgBox pops up and gives me: 25 December 2010. However once i try to put the value into a cell for example: Sheets("Sheet1").Range("A1").Value = strdate Instead of populating the cell with: 25 December 2010 ; Excel acts on it's own accord and populates the cell with the vexing entry configuration: 25-Dec-2010 !

Enter number into a cell and search an array for that number using a 2D range

那年仲夏 提交于 2020-01-07 03:49:20
问题 I am reconciling accounts and was wondering if there is a formula/VBA I can use to search for certain values, as the find function doesn't work? For example: enter -54.12 into a cell, formula/VBA searches an array for that number. This may explain better what I'm trying to achieve, albeit more of an explanation than coding: Sub Test() Dim Value As Integer Dim Account As Range Dim Lookup As Boolean Value = Range("D8") Account = Range("E:E") Set Value = A Set Account = B ' IF A is present in B

Iterate through spreadsheets in a folder and collect a value from each

本小妞迷上赌 提交于 2020-01-07 03:40:10
问题 I'm trying to write code that on Commandbutton2_Click searches through the folder that the file is in, takes a value from the same cell in each file and adds these together. I have this: Private Sub CommandButton2_Click() Dim lCount As Long Dim wbResults As Workbook Dim wbCodeBook As Workbook Dim strFolderPath As String Dim strToolNumber As String Dim RingCount As Integer RingCount = 0 strToolNumber = CStr(Sheets("Sheet1").Range("B9").Value) strFolderPath = "T:\Engineering\Tooling\Tooling