vba

Convert row with columns of data into column with multiple rows in Excel 2007

I have a row of data as follows: header1 header2 header3 header4 header5 row key datavalue1 datavalue2 datavalue3 datavalue4 datavalue5.... so basically, I have a denormalized data set where the datavalues may or may not be empty on a row-by-row basis. I need to normalize them. ie 1234567...

How to make the Excel broken autofilter indicator go away?

Excel 2003 Working with a large sheet which is typically autofiltered. However when autofilter is turned off the indicators are still all there, they just don't work. Not sure whether some vba was run which may have caused this. Other workbooks behave correctly on the same machine, and this workbook behaves this way on other machines. ...

visual basic - i need help

Hello! I'm really a beginner in vba and programming. I have to write a macro that simulates a binomial distribution where the price of something can only go up or down with the probability of p that is 50% this time. My variables: S=100 (the basic value) u=1,1 (how much the value goes up in each experiment if it goes up) d=1/u (how ...

In Outlook VBA, how can I change the subject so it changes the subject in the Explorer Pane?

When I receive an email, I'm manipulating the subject line so it is more readable and "conversations" generated by a certain auto-emailer actually contain all of the thread. I'm able to change the subject in the email view pane, but the subject remains the same in the explorer pane. How can I force the subject to change in the Explorer...

forcing excel to display a negative number as ($0,000)

how do i do this in vba? and how do i do this manually? ...

repeating specific rows on every page printed

how is it possible to print the same set of rows on every page that is printed on excel? how do i do this through vba? how do i do this manually? ...

Import file name into list box without path access 2007 vba-

Hi, I am creating a database where users can click a command button, they will be taken to a folder that is stored in a trusted location and they can choose a word document from there and all the names of chosen files will show in a list box on a form. We have the code to double click the file name to open the document. What we are looki...

excel group with hidden rows

I have an Excel sheet where several rows are grouped together using "Group and outline". By default the group is to be expanded but I have one row that I have hidden using vba in Workbook_Open. After I click the [-] to collapse the group and then the [+] to expand it again my hidden row is now visible. Is there a way to keep the hidd...

SendObject in MSAccess giving errors

I am getting the following error while sending mail using a button in MS access form I am using sendObject to send mail using vba code. The host 'smtp' could not be found. Please verify that you have entered the server name correctly. Account: 'pop3', Server: 'smtp', Protocol: SMTP, Port: 25, Secure(SSL): No, Socket Error: 11001, Erro...

MS Word VBA - Determine extent of "style run"?

Suppose I have a Range reference in Word VBA, and I want to break that down into smaller ranges where the formatting (font, colour, etc.) is identical. For example, if I start with: The quick brown fox jumped over the lazy dog. ...then I would want to get back 5 ranges, as follows: The quick brown fox jumped over the...

C# Interop Excel Macro With Password - Is It Possible????????

Does anyone know if it is possible to run a macro embedded inside a workbook which has a password enabled? Basically I am able to run a macro in a workbook already - However in my manager wants a freaking password added and I don't think thats possible Has anyone managed to get this in place? ...

How to setup a unit test in VBA Excel Macro?

Hello, I am working on an Excel VBA macro that will take some excel file, scrub / clean it, and produce a workbook with 2 sheets - sheet 1 being the original 'dirty' file, sheet 2 being the cleanly scrubbed file. Since we have 10 different formats right now, and down the road 40+.. I would like to save this output for a given set of f...

Adjusting Row Height Automatically in Excel

In excel (2003), I have a list of items on one page that my estimator can select from, and then on the invoice it prints the items selected....but I don't want blank lines for the items not selected. How do I get either the empty row height to be 0, or have the rows without data collapse. Is this possible. ...

Add Chart Data from other Workbooks into one series with VBA - Excel 2007

Hi All, I need to create a Chart which will grab data from external sources when a macro is run. Setting up the UserForm and all that is fine, all done, however I cant find out how to add another piece of the series. Is it even possible to have a series that sources data from several different locations? Basically I need it to go in ch...

How do I determine if a variant is a whole number in VBA?

Hellow I am looking for an elegant solution to determine if a variant is a whole number in VBA. Unfortunately, if the variant was created from a string, I am stuck. Here's a little test script: dim v as variant v = "42" if v <> round(v) then msgBox("<>") end if Here, the msgBox pops up, probably because the variant was created fro...

Connect to a linked table with code

Connect to a linked table with code I have some linked tables from a SQL-server; they are linked with an ODBC connection. The password is not saved with the connection. When I am double clicking on the table in Access table-view I get a prompt for username and password. After entering the password I can view the data in the table. My p...

Ms Excel -> 2 columns into a 2 dimensional array

Hi, Im coming from a Unix world where I never had to develop something for Office with VBA, I have to do some now and Im having a hard time! Please help me! :) So I've got 2 Excel Sheets(lets call them Sheet1 and Sheet2) and 2 forms(Form1 and Form2) to edit/add data. In Sheet1, the first two columns are MovieId and MovieName. We dont ...

Call VBA function from C#

Is it possible to call a VBA function (in Access) which takes two string parameters from the outside world (for instance from c# but others will do too)? ...

How can I hide Protected Excel AddIn Functions from Appearing in Insert Function Dialogue Box?

I recently discovered, however, that all public functions are displayed in the "Insert Function" dialogue box when you select "User Defined" in the "Or select a category" drop down list. This happens even if you password protect the project and lock it for viewing. To get to the "Insert Function" dialogue box press Shift-F3. Private f...

How do I reference to another (open or closed) workbook, and pull values back, in VBA? - Excel 2007

Hi all, Basically I need to gather a fair few figures from another workbook (Which is found and can be opened by a UserForm, therefore the location and names are variable). I need to use VBA for this as I also need to populate a chart with this data. I would prefer to not have to open the other workbook in order to do it, but if it is f...