Tagged Questions
1
vote
1answer
17 views
Conditional formatting on entire sheet via Macro
Need your help. In my Spreadsheet there is a macro that when activated test to see if a cell color in the entire set of data is pink. If one is found then the fist cell is marked pink, alerting me to ...
1
vote
1answer
18 views
Weird Excel bug when deleting sheet with named ranges?
I have an excel workbook that includes 2 worskheets, wkshtA and wkshtB. They both have local named ranges (the scope of each named range is just the parent sheet). Some cells in wksht B reference ...
1
vote
2answers
2k views
Excel 2003 VBA: Move a sheet into a new workbook that is referenced by a variable
I have a function that is meant to run the ShowPages() command of a PivotTable and then save each sheet to a separate file.
Here's how I wish I could do it:
Sub Split()
...
2
votes
4answers
59 views
Nested IFs and R1C1 Formula not working in VBA
I have the following formula which works perfect if I enter in Excel but when open the Macro it gives me an error and it highlights FRANCE.
Compile error Expected: end of statement
I am really ...
1
vote
1answer
856 views
How delete a series from an Excel chart using VBA
I'm trying to delete the empty series from a chart in Excel 2003 using VBA. I've seen that others have had this issue in the past and I have tried all methods mentioned in their posts but have been ...
0
votes
1answer
31 views
Passing values from C# to VBA code?
I am pretty new to VBA, sorry if this is simple question or already answered... I tried by searching on MSDN but did not get any thing to implement this.
I am in need of sending a string (Host name ...
1
vote
2answers
28 views
VBA - open excel, find and replace, delete row, save as csv
I am trying to write a program in VBA so that I can remotely manipulate an excel file from SAS (a statistical programming software). I want the program to accomplish the following:
open the ...
1
vote
1answer
73 views
VBA Excel - UPDATE record in ACCESS
I got a problem.
I want to update an existing record in table in Access Database using VBA in EXCEL.
My code:
sqlik = "UPDATE query which works in access"
Set ZAP_QUERY2 = baza.CreateQueryDef("", ...
-4
votes
2answers
67 views
Check if value in one column exists in another
I have a column of values (lets say column A) and I want to check if the value in column A is in column B (the address will be different). If the value is in column B I want to take the value and ...
13
votes
8answers
60k views
Row number of last cell with data
column A has data like this (ie frequent blank cells):
HEADING <-- this is A1
kfdsl
fdjgnm
fdkj
gdfkj
4353
fdjk <-- this is A9
I would like to be able to get the cell reference of the ...
-1
votes
0answers
18 views
date rangy with sum quantity macro
Hi friends i have one doubt i have date range like 1-7,8-14 and so on,and i want sum of quantity month wise and grand total also,i do`t know how to create macro,please send me the code!
Output
Date ...
1
vote
2answers
33 views
Extracting XML attribute using VBA
I'm not a developer and have very limited XML knowledge but for what I've learned the past 3-4 days researching on the web. So apologies in advance for the basic level of this question. I'm trying to ...
0
votes
1answer
1k views
Macro: Given row X copy specific cells from that row to a new sheet
I am working on a way to generate a list based on the value of each row in a given column (G). Currently the list can copy entire rows and works perfectly. It pulls all rows if column G contains the ...
0
votes
0answers
40 views
get recurring appointment item date between my date range
This is my piece of code.
outlook_Items.Sort "[Start]"
Set outlook_Items = outlook_Items.Restrict(strFilter)
For Each MyItem In outlook_Items
Set MyRecur = ...
1
vote
1answer
62 views
How to copy specific columns using VBA
Is there a way I can change the following code to only copy specific cells range or columsn:
For example: I have data in all columns from A to Z. I want to copy data to another sheet but I only want ...
0
votes
0answers
26 views
Invert a Covariance Matrix in VBA in order to solve a Matrix equation
I would like to solve an equation where I need to invert a Covariance matrix with VBA. The process of the study is as follow :
I need to calculate the vector X
X = M(inverted) * 1 / (1(transposed) ...
1
vote
2answers
48 views
Excel VBA Search Button
I am trying to use a text box and command button to search my entire workbook for a specific word or value. For example, "3132" or "Work Instructions". So far I am able to search the sheet that I am ...
1
vote
4answers
9k views
Saving excel worksheet to CSV files with filename+worksheet name using VB
I am very new with VB coading, I am trying to save multiple excel file worksheets to csv, I don't know how can I do for multiple but I found a way to do for single file. I have found codes in this ...
1
vote
1answer
22 views
run-time error '13': type mismatch VBA 2010 to ensure uppercase text in cell
Whats wrong with my code, every time i delete something on the worksheet it gives me a run-time error '13': type mismatch,
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address ...
0
votes
1answer
22 views
Cannot save file after upgrade to 2007 VBA
I have a sub which I call to save a file
Sub SaveToFile()
maxr = Worksheets("List").Range("H1")
Worksheets("List").Range("G1:AE" & maxr).Copy
Part of the code which is failing after ...
0
votes
2answers
24 views
Load_Click not working in VBA
I Have an excel worksheet which works fine on Excel 2003, however when I run in Excel 2007 onward I get a run time error exception '445', object doesn't support this action. The line it is referring ...
0
votes
1answer
25 views
jump into nearest date in a row if date entered not exist
my code is to find start and end date entered by user in the excel sheet so that user can find the number of product conversion for the period of entered date. it works okay if the user entered the ...
0
votes
1answer
30 views
Error “ 91” Object variable or With block variable not set
hi guys i am totally new to vba , i'm trying to set the value of a cell with one of the function parameters. The code is giving an error 91. the 6th line in the code is raising the error. I'm unable ...
3
votes
2answers
977 views
Replacing multiple invalid characters in a sheet name
I am writing a fairly large macro
which ends by saving the workbook with a name that the user inputted earlier on.
I am using the title of the sheet for this, so I need to strip out any reserved ...
1
vote
2answers
49 views
looping through a range of 2 columns
My question has been answered over and over but I don't understand the solutions and therefore can't customize them to fit my needs.
Here's a link to a solution on StackOverflow Loop through each row ...
0
votes
1answer
10 views
ActivePersonRecipient.Resolve returning FALSE even though the alias is present in outlook
i am trying to extract outlook names corresponding to aliases. however for two aliases ActivePersonRecipient.Resolve returns false even though the recipient is present in outlook
0
votes
0answers
27 views
Error Help: Adding to ranges using Application.Union
I am attempting to loop through a large list rows searching a specific column for values based on the values in another tab. I had it working for one value but as soon as I add a second criteria I am ...
0
votes
2answers
36 views
Why isn't this loop working correctly? I keep getting the error Method 'Range' of object '_Global' failed
I'm attempting to graph lnD and i, where i is the x-axis, and lnD is the y-axis. I have an equation that I'm putting a range of values for i into, and attempting to retrieve values of lnD.
However, I ...
0
votes
2answers
32 views
VBA index in function
I'm really new to VBA (10 hours) coming from a bit of a Python background. Is there a VBA equivilant to Python when it comes to indexing part of a returned function? This is what I mean:
If I have VBA ...
4
votes
5answers
2k views
Excel: list ranges targeted by INDIRECT formulas
We have a few very large Excel workbooks (dozens of tabs, over a MB each, very complex calculations) with many dozens, perhaps hundreds of formulas that use the dreaded INDIRECT function. These ...
3
votes
4answers
8k views
How do I create a status dialog box in Excel
I have created a database report generator in Excel. I am trying to create a dialog box that displays status information as the program runs.
When I generate the report, although the dialog box ...
0
votes
0answers
41 views
QueryTable refresh generates two HTTP GETs
The following VBA in Excel 2007 generates a call to a perl script on the host. It works exactly as intended, except it consistently generates two calls. First the code:
With ...
1
vote
4answers
686 views
Modifying a spreadsheet using a VB macro
I have two spreadsheets... when one gets modified in a certain way I want to have a macro run that modifies the second in an appropriate manner. I've already isolated the event I need to act on (the ...
1
vote
0answers
22 views
Macro to send two different mail when a cell reaches two different values (right)
Excuse me for my English.
I offer to you my best compliments for this very useful and well done website.
Now I'm developing a program very complex Excel in which I predicted the attached Code Macro, ...
2
votes
3answers
6k views
How do you prevent printing dialog when using Excel PrintOut method
When I use the PrintOut method to print a Worksheet object to a printer, the "Printing" dialog (showing filename, destination printer, pages printed and a Cancel button) is displayed even though I ...
0
votes
1answer
21 views
Can't delete sheet
I'm trying to open a workbook and delete a sheet from it, but it runs the code without errors, and the sheet is still there...
I'm able to modify it, as I changed formulas to values on another sheet.
...
20
votes
5answers
41k views
Macro to save each sheet in an Excel workbook to separate CSV files
How do I save each sheet in an Excel workbook to separate CSV files with a macro?
I have an excel with multiple sheets and I was looking for a macro that will save each sheet to a separate CSV (comma ...
0
votes
1answer
22 views
VBA script to compare 2 sheets and delete duplicated cells “Big Search Range”
I want a script that compare "sheet 1 cells" with "sheet 2 Cells" and delete duplicates from sheet 2. I am using now this script
Option Explicit
Sub CleanDupes()
Dim targetArray, searchArray
Dim ...
0
votes
0answers
31 views
skip empty cells in combobox vba
i am trying to create a combobox in vba wich get its data from a column in a sheet called "data" ,the problem is that it shows empty cells. The code that i used for that so far is :
Private Sub ...
0
votes
0answers
18 views
Automated PivotTables from filter Excel VBA
Basically i have a macro for excel that creates a pivot table based on another worksheet in my workbook. This PivotTable includes a filter for Faculty. What i would like to do is create a macro that ...
0
votes
1answer
37 views
listening file changes in VBA Excel
I have a text file with two lines with on/off and continue/finish which are settled by another program. A VBA program must wait or proceed depending the string value in the first line and stop ...
0
votes
1answer
38 views
Splitting a semicolon-separated string in an Excel function
Is it possible to create an Excel-Function to split a semicolon-separated string to n adjacent cells?
I can create a function which does the opposite (concat the values of n cells via semicolon and ...
1
vote
2answers
27 views
VBA: Dictionary - Can only retrieve the last entry
This is probably a newbie mistake where I'm not aware of some setting that I haven't changed. Anyways, I'm trying use Dictionary to store a instances of class I've created.
Class cls_Connote is just ...
0
votes
1answer
19 views
Excel VBA window object ScrollworkbookTabs function issue
This VBA code is for an application that does a side-by-side comparison of two worksheets in the same Excel 2010 workbook. The code achieves it's purpose, but has some strange side effects: - Without ...
0
votes
1answer
35 views
Macro Compilation error
I have a excel sheet "b.xls" in which column A and column B have content like this:
Column A Column B
C1 F1
C2 F2
C3 Z3
I want to copy content at location C1 , C2 , and C3 ...
0
votes
1answer
30 views
Stopping Decimal Truncation in Visual Basic
How can I stop a decimal from being truncated in Visual Basic, and keep it as a full decimal rather than a truncated number in scientific notation?
I have this little bit of code from am Excel Macro ...
0
votes
1answer
38 views
Excel converts cell address to date
I am saving cell addresses in a sheet but Excel converts some cells addresses to date like OCT8 to Oct-08, APR8 to apr-08.
Later on when getting cell values it gives date not cell addresses stored in ...
0
votes
1answer
26 views
Excel Sheet Codenames in Formula VBA
I'm trying to create a formula in VBA to match some rows. Currently I have something like:
ActiveCell.FormulaR1C1 = _
"=INDEX('Report 2'!C[4],MATCH(Report!RC[2],'Report 2'!C[8],0))"
Where the sheet ...
0
votes
2answers
2k views
How to open Text File with .OpenText in VBA that starts with first column like “ID” without getting SYLK error
I've come across a nasty little bug in Excel VBA's .OpenText method.. It errors on opening any text or CSV file when the first two letters are upper-case "ID". Here is the article from MS so you ...
2
votes
2answers
45 views
VBA Excel Won't Change Cell to the Right Color
I am new with using VBA macros in excel, and I am trying to change the background color of a cell based on the condition that another cell is not empty. I thought I had it figured out, but I must be ...