excel-vba

MS Access 2003 - Embedded Excel Spreadsheet on Access form

Let's say I have an embedded Excel Spreadsheet on a Microsoft Access form. I call the object frame ExcelFrame and I add a text box on the form called txtA1 and I add a button on the form called cmdInsert I want to type "Hello World" into the text box, click the button and have it appear in the A1 cell on that spreadsheet. What V...

How Display Excel rows on selection of first Excel Column Value

Hi, I have Two Excel sheets. My requirement is when i select Reason Value From First Excel sheet Reason Column. It will display respected Reason Value in Second Excel. So using Macro i want to Display Second Excel Rows on selection of reason in first excel. Please Help. First Excel is And Reason Column Contains Reason1 , Reason 2 et...

How to get a particular part of a String

I am writing a macro in Excel where I need to get a substring from a String. Its like this. ~/tester/test/hai/bye ~/stack/overflow/hai/bye In the above cases I need to take the String tester from the first one and stack from the second one.I tried using the Instr but its not useful.Can anyone help this? ...

Excel VBA - How to copy/transpose multiple columns record into individual single row

I'm working on data migration, need some help on doing a macro to copy/transpose multiple columns record into individual single row. There are also a "tag" in the first row, which indicates the columns that should not be included in the copy/transpose. From: Tag . . . . . . . . . .x Name Jan Feb Mar Apr Larry 2 2...

I'd like to add a button to an Excel Spreadsheet which triggers some VB code to animate some cell values ...

Hi, I'd like to do the following: Add a button to an Excel spreadsheet. When I click the button, it automatically starts to increment cell B2 (for example) from 0 to 100, and back again, in an endless loop. When I click the button again, the animation will stop. How do I solve this problem? Shane. ...

Excel found unreadable content in ...

Hi, When I open an excel file (generated through VBA code), I get an error "Excel found unreadable content in <filename>. Do you want to recover the contents?" Upon clicking yes, I get a message 'Repairs were made to PivotTable report 'pvtName' on '[filename.xls]Tab'.' The pivot table in question is generated by the VBA code. Is ...

Excel VBA: Sum invoice by client id with copying result to new worksheet

Hi, i have strange problem doing reporting: i have numerous clients with different issued invoices. Problem comes to the point when there are invoices in minus and plus: Column A consists of client unique IDs, Column B invoice number, column C invoice amount A | B | C 0010019991 | 1800149471 | 162.00 | 2010-03-12 ...

Excel VBA merge many columns into one on separate rows

I have a large array of cells in multiple columns that need to be combined into one large column with a new row for each cell. I do NOT want to merge the contents of any cells. ...

How do I repeat function over several row.

I'll admit that I'm not an Excel guru so maybe someone here can help me. On my worksheet I have several blocks of data. I calculate the sum of all items within column D of that block. Within each block I am checking the value of the cell in column C and if it contains the letter "y" and the value in column D of that row is equal to zer...

How do you set the "global delimiter" in Excel using VBA?

I've noticed that if I use the text-to-columns feature with comma as the delimiter, any comma-delimited data I paste into Excel after that will be automatically split into columns. This makes me think Excel must have some kind of global delimiter. If this is true, how would I set this global delimiter using Excel VBA? Is it possible to...

Mass saving xls as csv

hi, here's the trick. gotta convert 'bout 300 files from xls to csv, wrote some simple macro to do it, here's the code: Dim wb As Workbook For Each wb In Application.Workbooks wb.Activate Rows("1:1").Select Selection.Delete Shift:=xlUp ActiveWorkbook.SaveAs Filename:= _ "C:\samplepath\CBM Cennik " & ActiveWorkbook....

classic asp delete rows and columns from an excel file

Hi, how can I remove specific rows and columns from an excel file using only classic ASP? For example, given the excel file col1 col2 col3 one two three four five six I want to be able to programmatically delete the first row and second column to produce one three four six Thanks! ...

Using Excel to work with SQL data (read/write)

I have a ton of data in a sql database which I would like to be able to import and display in excel (I can already do this) and additionally modify or append to the dataset within excel and write the changes/additions back to the database. What is the best way to go about doing something like this? Please let me know, thanks! ...

Excel 2003 VBA - Method to duplicate this code that select and colors rows

so this is a fragment of a procedure that exports a dataset from access to excel Dim rs As Recordset Dim intMaxCol As Integer Dim intMaxRow As Integer Dim objxls As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Set rs = CurrentDb.OpenRecordset("qryOutput", dbOpenSnapshot) intMaxCol = rs.Fields.Count If...

Excel 2003 - VBA for looping through every cell in a row to provide attributes/formatting

say I want to make the first row of the excel ss something like this: .Rows("1:1").Select With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With ...

Way for Excel VBA to use shadowed chart event handler

I have a embedded chart and I want to modify the behavior on the mouseDown event but only when it occurs on a dataSeries (xlSeries). But for all other elements (axis, plot area, gridline, etc), I want it to fall back on the default mouseDown behavior. Is this possible? Thanks. ...

How to reference an embedded PowerPoint or Excel file in a form in Access?

So if I was to take a an Access form, and embed either an Excel spreadsheet into it or a PowerPoint deck, how would I reference it in VBA code? I know I have to set the libraries, name the frame of the OLE object, and use applicable syntax to whatever I want to do, with whatever I stick in the form, however the only things I have ever d...

Populate new row with VBA button click

Hi, I am trying to create a list that adds a new row of data each time a button is clicked. I have the following code assigned to the button when clicked: PurchaseDate = InputBox("Enter Purchase Date:") Sheets("TrackRecord").Select i = 0 Row = i + 1 Range("A2").Select ActiveCell.FormulaR1C1 = Row Range("B2...

Unable to change the range of source data in Pivot Table in Excel VBA at run time

Hi All, I want to change the source data of my PivotTable in the code at run time. Please let me know how do i do that. Regards, Vikram. ...

Using Excel To Read Access Without MS Access On Computer

I have written code that joins two table in access, using criteria supplied from drop down lists in excel and then returns the data to a specific location on the spreadsheet (titles already on the sheet). This works fine on my box and others with MS Access on the machine, but the purpose of writing this was to give people (associates) th...