excel-2010

Can't format the date properly in VBA, Excel 2012

拟墨画扇 提交于 2019-12-19 04:26:16
问题 I'm working on a VBA script in Excel 2010 that picks up certain events from a MySQL database based on the dates of the events. The dates in the database are stored in a "yyyy-mm-dd hh:mm:ss" . My users will be using a from-to date range to filter the events they are interested in. To make it easier for them I use two calendar controls (mscal.ocx) for the range - Calendar1 for from and Calendar2 for to. I wrote two simple subroutines to make sure that every click on the calendars automatically

How to merge cells based on similar values - Excel 2010

て烟熏妆下的殇ゞ 提交于 2019-12-19 04:20:12
问题 I have a problem merging cells in excel based on similar values for one column- I would like to keep other columns data - let's view some screenshots and it will be clearer: This above is the initial state of the Data, what I want to achieve is this: I'm sure there is a way to do it with VB or formulas- I need the most simple way possible as this is for a customer and it needs to be easy. Thank you all in advanced. 回答1: Option Explicit Private Sub MergeCells() Application.ScreenUpdating =

XmlHttp Post in Excel VBA not updating website form

时光怂恿深爱的人放手 提交于 2019-12-19 04:05:11
问题 I routinely have to search the state of NV for unclaimed property and put the results in an Excel spreadsheet. I am trying to automate the process but I'm limited to using Excel 2010 and VBA. Below is the URL to the site I'm trying to submit a form using xmlhttp. URL: https://nevadatreasurer.gov/UPSearch/ I created a class to automate submitting forms on other websites but no matter what I enter in the postdata the form is never submitted. Below is my submission, and method to submit the form

Add tooltip to Excel Add-in Custom Ribbon UI XML

为君一笑 提交于 2019-12-19 02:09:13
问题 I am creating an Excel Add-In that has a custom Ribbon UI. I would like to add a tooltip for my buttons. What XML attributes can I use to set this? <button id="insertStuff" label="Insert Stuff" size="large" onAction="InsertStuff_EventHandler" imageMso="AddAccount" /> 回答1: You can use "screentip" and "supertip": <button id="insertStuff" screentip="Tooltip title" supertip="Long description" ... BTW, you should have autocomplete normally when you edit the ribbon XML in VS. If you don't make sure

How to use “This Row” in VBA VLOOKUP?

强颜欢笑 提交于 2019-12-18 09:53:32
问题 I am trying to modify a Vlookup function so that it uses "this row" functionality. For example I have a macro that places in Column B the Following formula: =VLOOKUP(I1253,treatlookup,11,FALSE) This works well, however during the macro, I need to have it switch over to another formula: =VLOOKUP(I1253,Itemlookup,22,FALSE) Of course the data varies everytime so I can not just have that formula put in at a specific cell. So what I would like the formula to state is = Vlookup(I"CurrentRow",

AutoFilter Criteria Using Array (Error) - Too Large String?

隐身守侯 提交于 2019-12-18 08:55:17
问题 Update: Through some additional testing I discovered: 1) 255 Characters does seem to be the breaking point (character limit). Setting the filter with an array with a character length of 245 worked fine -- I was able to save and reopen without any errors. I added another criteria to the array to make the length 262, saved the file, and then got the same error. 2) The sheet in the removed records message refers to the sheet index , not the sheet name, and it does indeed reference the sheet with

VBA Get Username on OSX (or Mac alternative to Environ(“username”))

☆樱花仙子☆ 提交于 2019-12-18 08:32:33
问题 My task has been to create a secure (Windows version) Excel workbook that uses macros to validate whether a user has permission to view the contents. In Excel 2010 for Windows, I use the Environ("username") function to accomplish this. The problem I'm running into is that some users in the organization use a Mac to do their daily work, and Environ does not work with OSX. Does anyone know of an alternate way to find the username of a Mac? I've looked online but all I can find is how to find

Excel VBA - After Data Import [duplicate]

送分小仙女□ 提交于 2019-12-18 07:24:24
问题 This question already has answers here : Excel VBA - QueryTable AfterRefresh function not being called after Refresh completes (2 answers) Closed 2 years ago . I need to create an event to apply certain code after data connections (text files) have refreshed. How do i control when the data is refreshed. 回答1: Turn off background refresh on your connections before you do anything else. Then use ActiveWorkbook.RefreshAll any code placed after will not execute till after the refresh, as long as

Sorting Alphabetically and by Cell Color

╄→尐↘猪︶ㄣ 提交于 2019-12-18 07:09:05
问题 I'm trying to sort multiple lists Alphabetically and by Cell Color but within a certain range (so it doesn't take too long). Basically the VBA is suppose to select for example column B rows 3-88, sort by alphabet, then sort by color. Then move to next column C3:C88, etc, until column NY. When I try it, I get Run-time error 1004: Mathod "Range" of object '_Global' failed. This is my VBA: Sub SortAlphaColor() ' Sorts rows within a list from A-Z ' Run Clean all first to avoid sorting blanks '

Apache-POI: Unable to write to an existing workbook

我是研究僧i 提交于 2019-12-18 05:46:16
问题 I'm working on a project which needs to read an Excel Workbook, calls the necessary Web Services, and then takes the response from the webservices and enters that information in to the same Excel Workbook that was read. Here is the error I'm seeing when trying to write to the Excel Workbook: Exception in thread "main" org.apache.poi.POIXMLException: java.io.IOException: Can't obtain the input stream from /docProps/app.xml at org.apache.poi.POIXMLDocument.getProperties(POIXMLDocument.java:141)