excel-vba

Copying data from/to excel worksheet using a macro

I have the below code that is suppose to copy data from an excel file I receive in a email and paste it to another file on the row that has the same date. When I try and run the macro it says there is an error. Can anyone look at my code and direct me as to where my error is. I am fairly new to coding and creating macros. Sub CopyDataTo...

vba loop through cell edges for border

Basically, I want to loop through the edges in the Borders collection. is there any "for each" way to do this? Private Function getCellBorder(ByVal vArg As Range) As String For Each Edge in Borders Debug.Print vArg.Borders(Edge).LineStyle Next Edge End Function ...

conditional copying in excel

hi i need some help with vba. i know that when you want to copy excel cells based on a condition, you do so by right clicking the sheet and entering the visual basic screen. thing is, i'm not very familiarized with vb. i've read some similar posts but haven't been able to understand them completely. this is what i want to do: i...

Microsoft Excel Power Pivot - how to add data to an existing power pivot table

Hi, I'm looking for a way to load more recent data as date x in Power Pivot and link/add them to an existing table. Background: The user downloads data from a datafeed and saves them in Excel Power Pivot. The data will be deleted from the server afterwards. In the next step, new data must be added to the existing table in Power Pivot...

Delete a MS Word Page using macros

Hi All, How can I delete certain page from MS Word document using macros? The code should be compatible from 2000 to Word 2010. I've tried using page bookmark to delete page but, output is varying in different versions. Is there any other solution than this? ...

I'd like to copy data from multiple sheets/tabs to a Master sheet

What I have is a spreadsheet with over 100 tabs with relatively the same format of data, but some sheets have more or less rows than others. I have a sheet named EMP_NUM with all employee numbers and names. I have a Master sheet that I would like all the relative data copied to the Master sheet. The employee numbers listed on sheet EM...

vba: return dictionary from function

this outlines what i am trying to do. this is not working for me, and it is unclear why. thank you in advance for any and all help. Sub mySub() dim myDict as Dictionary myDict=new Dictionary myDict=myFunc() End Sub Function myFunc() dim myDict2 ...

VBA - Automated Excel 2007 Document in Visual Studio

I have currently written a sub, written in VBA, that is called by the click of a button on an excel document. The sub takes data in the cells of the document and sends them to a web service. All of this works flawlessly when Visual Studio automates Excel. I am wondering if there is a way to save this excel file to where it does not ne...

How can I find the name of the currently open Excel document using vba?

I'm using vba in Excel 2007 to read a spreadsheet and modify it's contents. I need to save the results with a name that is similar to the original file, but with some alterations. How can I programmatically find the name of the currently open file using vba? Thanks in advance. ...

How can I distribute a number of values Normally in Excel VBA

Hi All, Sorry I know the question isnt as specific as it could be. I am currently working on a replenishment forecasting system for a clothing company (dont ask why it's in VBA). The module I am currently working on is distribution forecasts down to a size level. The idea is that the planners can forecast the number to sell, then can sp...

How can I insert the quoted price of gold from kitco.com into my excel spreadsheet?

kitco.com provides a realtime price quote for gold and other metals. I have a spreadsheet which makes calculations based on the price of gold and would like for this realtime value to automatically be updated on my excel sheet. I tried 'get external data' from a website but that didn't work. any ideas? EDIT ADDED: Kitco has a gadget cal...

How can I control moving cursor movement after entering a value in a cell?

I would like to control which cell the cursor should or should not move to after entering a value in a particular cell. ...

Can I fire-up an Access 2007 app from within Excel and automatically import excel values into Access?

I have a pawnshop app where when a customer arrives at the shop, the clerk uses an Excel worksheet to calculate how much money he can lend to the customer, based on the current market price of gold, gold karats and weight. If the customer agrees with the calculated amount, the clerk then goes into my Access 2007 pawnshop app and has to r...