Re: $$Excel-Macros$$ Union to transfor a non-contiguous to a contiguous range In VBA

2011-09-28 Thread excelCPA
a way to do this? Thanks. On Sep 28, 12:17 pm, ashish koul wrote: > Sub union_data() > Dim s As Range, unrng As Range > Set unrng = Union(Range("b1:b4"), Range("c4")) > For Each s In unrng > MsgBox s.Value > Next > End Sub > > > > > > O

$$Excel-Macros$$ Union to transfor a non-contiguous to a contiguous range In VBA

2011-09-28 Thread excelCPA
I am trying (unsuccessfully) to dynamically transform a single column non-contiguous data range to single column contiguous range using VBA, basically dynamically appending the second range to the first. My spreadsheet is as follows: Column A contains a series of dates in sequential order Column

$$Excel-Macros$$ Re: Capture Sheet Range in 2D VBA Array

2010-03-31 Thread excelCPA
Thanks for the reply, I had thought of this technique and got it to work. I am only using a 2X5 array for this simple example, but my actual array is much larger (actually I have two 100,000 X 8 arrays) and I am trying to find a direct way to capture a range without excessive programming. Also th

$$Excel-Macros$$ Capture Sheet Range in 2D VBA Array

2010-03-29 Thread excelCPA
I have a macro that runs an iterative process (5 cycles) and I want to capture a range from a worksheet with the results of each cycle between iterations in a simple two-dimensional array in VBA and get an average at the end. The results of the calculations are in cells A1:B1 of the worksheet “Res

$$Excel-Macros$$ Re: VBA Array Statistics (Min, Max, Sum, Avg, StdDev, etc)

2010-03-25 Thread excelCPA
number of each scenario analyzed and 1,1 being price and quantity results respectively. How do I get the average or price only or the quantity only, or average of price for results 1 to 500 and so on? Thanks. On Mar 23, 2:26 pm, excelCPA wrote: > I have just begun to work with arrays

$$Excel-Macros$$ VBA Array Statistics (Min, Max, Sum, Avg, StdDev, etc)

2010-03-23 Thread excelCPA
I have just begun to work with arrays in Excel VBA and am struggling how to obtain basic statistics about the array. For example Dim Results_Array(1 to 10) As Double I run a loop that calculates 10 numbers and places the results in places 1 - 10 in the array. How can I compute the average, sum,

$$Excel-Macros$$ Re: Create Goal Seek Function in Excel using VBA

2010-03-04 Thread excelCPA
Should be noted in the example above, cell F3 would be the cell were the =GoalSeek formula would be entered. Basically I want the function to assume the "by changing" cell is itself. On Mar 4, 9:23 am, excelCPA wrote: > I want to creat a function in Excel to use Goal Seek.

$$Excel-Macros$$ Create Goal Seek Function in Excel using VBA

2010-03-04 Thread excelCPA
I want to creat a function in Excel to use Goal Seek. I am new to creating fuctions, so I'll need some help on this one. Right now I have something that looks like this which does not work: Function GoalSeek(Target_Cell, Goal, Changing_Cell) As Number GoalSeek = Range(Traget_Cell).GoalSeek

Re: $$Excel-Macros$$ IF statement to test if Excel Clipboard is Empty

2010-01-27 Thread excelCPA
Thanks. I tried this one, unfortunately it errors out at line: stext = MyData.GetText when the clipboard is empty. I get the error: Run0time error '-2147221404 (80040064)': DataObject:GetText Invalid FORMATETC structure I like this one because it seems to check for text, which is what I want,

$$Excel-Macros$$ IF statement to test if Excel Clipboard is Empty

2010-01-26 Thread excelCPA
I need to write an IF statment in VBA to test if the Excel clipboard if empty. Please advise. Also, what is the best way to clear the clipboard in VBA, I'm using: Application.CutCopyMode = False But this doesn't always seem to work. thanks. --

$$Excel-Macros$$ Call Access Macro from Excel using VBA

2010-01-18 Thread excelCPA
I have a spreadsheet that is connected to an Access database using the “Get External Data” feature of Excel. The Access database has simple macro that executes to refresh the data used by the queries. Right now, whenever I want to refresh the tables in Access, I have to open the databases and run

$$Excel-Macros$$ No Data Validation when using Paste Values

2009-12-18 Thread excelCPA
I have a spreadsheet with multiple data validations that I want users to paste values to. Unfortunately, I've noted that the data validation rules don't apply when you paste values. Do anyone know a work around? Thanks. -- ---

Re: $$Excel-Macros$$ VBA Security - Restrict Users from Editing VBA Macros

2009-12-06 Thread excelCPA
A > Mobile: +91 9810929744 > dilipan...@gmail.com > dilipan...@yahoo.com > New Delhi - 110062 > > On 11/30/09, excelCPA wrote: > > > > > > > Does anyone know of a way in Excel 2003 or 2007 to restrict end-users > > from viewi

Re: $$Excel-Macros$$ Run-time error '1004': PasteSpecial method of Range class failed

2009-12-01 Thread excelCPA
I have tried recording it manually using a macro as Dave suggested and the code Deepak suggested with no luck. Here's the weird part, if the source is anything other than another Excel workbook, the past special code works fine. For example if I copy something out of Word, IE, Outlook, or even th

$$Excel-Macros$$ Run-time error '1004': PasteSpecial method of Range class failed

2009-11-30 Thread excelCPA
This is something that seems pretty simple, I am trying to paste values into a workbook using a macro: Range("A1").Select Selection.PasteSpecial Paste:=xlPasteValues I start out by manually copying a range of cells in a separate workbook and clicking a form button to paste the values. Each time

$$Excel-Macros$$ VBA Security - Restrict Users from Editing VBA Macros

2009-11-30 Thread excelCPA
Does anyone know of a way in Excel 2003 or 2007 to restrict end-users from viewing or editing VBA macros, but still allow them to enter data in the spreadsheet and execute macros via a form button? Thanks. -- -- Some