I am an Excel VBA newbie. My apologies if I am asking what seems to be an obvious question.
I have a CSV text file I am opening in an Excel worksheet. One row of the file contains date information formatted as "YY-MMM', (ie: 9-FEB, or 10-MAY). When the Excel spreadsheet opens the file the date information is changed to "mm/dd/yyyy" forma...
I have a spreadsheet which cells in are colored meaningfully.
Does any body know how i can return the background color value of a current cell in Excel sheet?
...
I am new to VBA and am trying to figure out how to reverse the order of a selected range of columns without hard coding. Every example I look out either hard codes the columns to reverse the order of, or assumes you want to reverse all the columns in the worksheet. I'm not trying to ask someone to write this for me, but as simple as this...
How can I write a one line macro to write two different words in cell A1 and A2?
...
I am using an excel macro to generate an RSS feed. The user's timezone offset needs to go in the field of the RSS feed. How can I do this programatically in the excel macro function?
...
I have seen this before in SQL and VB, I am now reverse engineering an Excel speadsheet and have come across the following formula:
=IF(D23<>0,"Insufficent",0)
I am converting it to ActionScript:
var result:String = [condition] ? 0 : "Insufficient";
but I am unsure of what D23 <> 0 means, is it simply "not equal"?
...
I distribute an Excel workbook to a number of users, and they are supposed to have a particular macro file pre-installed in their XLSTART folder.
If they don't have the macro installed correctly, and they send the workbook back to me, any formulas depending on it include the full path of the macro, e.g.:
'C:\Documents and Settings\rich...
As I understand it when I create an Excel sheet with VBA code the VBA code is saved as binary with the sheet. I therefore can't put the code into source control in a useful way, have multiple devs working on the problems, diffing is difficult, etc.
Is there a way round this without switching to VSTO, COM addins etc? E.g. for the sheet...
Let's (for discussion purposes) say that I have x and y data in 2 columns. They're some measured data which, several times a day, a few of them are added (usually 4 times a day).
Now, I wish to plot y=f(x) (linear scale), but the problem is since data is constantly added to determine the number of points which will go in the plot. Always...
How does one open a semicolon delimited CSV file with VBA in Excel 2000?
In Excel 2003 11.8231.8221 SP3 with VBA 6.5.1025, I can open a semicolon delimited file with the following VBA code:
Workbooks.OpenText filename:=myFilename, _
DataType:=xlDelimited, Semicolon:=True, Local:=True
However, when the same code is run in Excel 20...
Suppose I have a function attached to one of my Excel sheets:
Public Function foo(bar As Integer) as integer
foo = 42
End Function
How can I get the results of foo returned to a cell on my sheet? I've tried "=foo(10)", but all it gives me is "#NAME?"
I've also tried =[filename]!foo(10) and [sheetname]!foo(10) with no change.
...
I need to create labels and buttons dynamically and then add them to a frame within a userform. How do I do this? Seems like it should be easier than it really is.
...
I have created an ActiveX control using C++. I use Visual Basic code to instance the control in an Excel worksheet. I can only run the VB script once, subsequent runs cause the following runtime error when attempting to access the 'ActiveSheet' variable:
Microsoft Visual Basic
Run-time error '-2147319765 (8002802b)':
Automation erro...
I need to make some custom objects in VBA that will need to reference each other and I have a some issues.
First - how do object constructors work in VBA? Are there constructors?
Second - are there destructors? How does VBA handle the end of the object lifecycle? If I have an object that references others (and this is their only refere...
I want to search through existing Excel files with a macro, but I don't want to display those files when they're opened by the code. Is there a way to have them open "in the background", so to speak?
...
I want to insert a list (below: generator, control tower, etc.) repeatedly throughout a spreadsheet. It should be inserted every other row (after each Turbine) and offset one column as shown below. I don't know how to write a macro to do this automatically. Any help is appreciated.
TURBINE A-2
Generator
Control Tower
Brak...
I have disabled "cut" in my excel and have changed paste to paste-special (values) only in my function called "stoppaste". I have written this code in Workbook_Activate, Workbook_SheetActivate. The code is given below:
Application.CellDragAndDrop = False
Application.CommandBars("Edit").Controls("Paste").Enabled = False
Application.Com...
Does anyone know a way to export the VBA code from a number of Excel documents, so that the code can be added into a subversion repository? Without having to manually open each document and export the code.
...
I made a VBA project based on Excel and Access. When I copied to other computers, some methods (left, right, etc) or controls (ComboBox) sometimes disabled. I had to rebuild in that computer. But sometimes it's OK. Why? Is that because of licence issues?
...
I saw a lot of examples in MSDN on how to use MSHTML in VS. Have anyone known if and how we can use MSHTML and VBA to open web pages?
Thanks.
...