Create Virtual Range
Apr 11, 2007
Is it possible in VBA to instance a range without assigning it to a location in a worksheet? I want to use functions like mmult to manipulate "matrices". I don't think that mmult can handle arrays, so I wanted to use ranges. However, I am running lots of iterations, so I would prefer to keep the calculations in memory only.
View 4 Replies
ADVERTISEMENT
Dec 10, 2008
Matching criteria from a Virtual ( Non-Existing Range)
I need help on two things:
1> Virtual Range
2> Displaying TRUE or FALSE
I want to perform a Lookup Using the Regular Match Function with the following Syntax for checking Dates falling in a Fixed Range...
View 14 Replies
View Related
Jul 9, 2008
I'm trying to copy over some data from 1 sheet to another..... I have filled in some data in the range A5:AG11 on my source sheet, and i intend to copy over the lot (although actually, only row 5 may be populated), and paste into another sheet.
I have 2 problems: firstly, the columns in my 2nd sheet dont match up exactly with the format of my source sheet, so i need to copy & paste the data in 2 parts... column A into column A of my destination sheet, and columns B:AG into columns D:AI of my destination sheet.
Secondly, as i'm pasting all 6 rows, regardless of if they are blank or not, excel seems to paste in virtual blank cells, with no data or spaces in any trailing row.... so, for eg:
Sheets("Overview").Range("A65500").Select
Selection.End(xlUp).Select
Do While Not IsEmpty(Selection)
Selection.Offset(1, 0).Select
Loop
Now selects a blank cell about 5 cells down from the first 'proper' blank cell.
how to vanish these virtual spaces it's putting in?
View 9 Replies
View Related
Mar 7, 2014
When I press SORT A-Z (through a column filter) on my spreadsheet, I want something like this to happen. Is it possible?
EXCEL.jpg
View 4 Replies
View Related
Dec 13, 2007
I have been working on a spreadsheet to manage my players in a virtual sports game. I have worked out that the optimum skill scores for all the positions and want a way to compare a player to the optimum.
For example:
1st2nd3rd4th5th6th7th
Position 147.1737.6742.0533.8313.6711.3317.33
These are the averages for Position 1
How do I find the player who closest matches this optimum. Players have scores in the same 7 skill areas.
View 9 Replies
View Related
Jul 21, 2013
I have a range that I named. Let's say that range is called "RangeX". Let's say RangeX is defined by B2:E10
I have a series of formulas that give me the row and column numbers of the starting and ending cell of a subset range I want to create within RangeX. Let's say the starting cell is defined by (1,1) and the ending cell is defined by (3,4) within RangeX. Translated, the starting cell would be B2 and the ending cell would be E4.
How do I create a subset range using the starting cell (1,1) and (3,4) in VBA? I would like to use the row/column reference as RangeX itself could move around.
View 1 Replies
View Related
Aug 20, 2013
In column A I have a range of file path extensions (i.e., C:UsersJSmithDocumentsModelsHic Sunt DraconesTest.xlsx). What I want is a macro that will use those file path extensions to create hyperlinks in column B.
So far this is what I have:
VB:
Sub Hyperlink()
Range("a1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=Range("b1").Value, SubAddress:= _
"", TextToDisplay:="Link"
End Sub
This code works for the first cell, but does not work for the rest of the cells in the range. Also. Keep in mind that the range of cells in column A is dynamic - it changes in length.
View 5 Replies
View Related
May 8, 2009
I'm trying to built a range to be used at SUMIF. I have the sheet names at column A:A and want to create something dynamic to avoid selecting sheet by sheet all the neccesary ranges but sumif doesn't recognize a range like A1&"!"&B:B for example. I tried different ways but I can't get it!
View 2 Replies
View Related
Mar 5, 2009
I have a spreadsheet with up to 3000 rows. I have created a macro that subtotals column J and L based on changes in col. A. I now need to create a range beginning with column "A2" thru Column "D2" to last row of data in column a, but offset (-1,0) due to the Grand Total Row. I then have a macro to do a Go To Special to fill the blanks. I am having trouble because each month the number of rows will change.
View 3 Replies
View Related
Mar 16, 2007
How to create a ' range box' on a form that allows you to drag and select a range, like a type 8 InputBox?
View 9 Replies
View Related
Feb 26, 2008
This is more acedemic than anything, but I'm trying to create a range that refers to ranges on more than one sheet... is this possible? "Union" doesnt appear to work when the ranges are on different sheets. Netither of the Set My_Range3 statements work below.
Option Explicit
Public Sub test()
Dim My_Range1 As range
Dim My_Range2 As range
Dim My_Range3 As range
Set My_Range1 = Worksheets(1).range("A1:A10")
Set My_Range2 = Worksheets(2).range("B1:B10")
'Set My_Range3 = Union(My_Range1, My_Range2)
'Set My_Range3 = range(My_Range1, My_Range2)
My_Range3.Interior.ColorIndex = 3
End Sub
Both Set My_Range3 statements will work if the ranges are on the same worksheet.
View 4 Replies
View Related
Jan 14, 2014
why I'm getting an error with this code. I have a data set that becomes larger each time I run the report, so by selecting all the cells and naming the range, I don't have to hard-code the cells involved. Then, I want to be able to create a table from that named range. The error comes on the last line of code.
VB:
ActiveSheet.Range("A1").Select
ActiveSheet.Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Range(Selection, Selection.End(xlToRight)).Select
Selection.Name = "TestRange"
ActiveSheet.ListObjects.Add(xlSrcRange, Range("TestRange"), , xlYes).Name = "Table2"
View 9 Replies
View Related
Feb 20, 2014
I have a macro that using a list of values in a range, checks if there is a corresponding worksheet and if not, use the Template to create one, rename the worksheet and add the value into a cell.
I now have 2 types of template and based upon on the value in the range, I want it to create a worksheet using 'Template 1' for all values < 1000 and 'Template 2' for values > 1000.
Is it possible to amend my code for this?
HTML Code:
Sub CreateTimeline()
Dim rng As Range
Set rng = Application.Range("Projects[No.]")
[Code]....
View 2 Replies
View Related
Sep 17, 2009
I want to create ranges in a worksheet that is inactive.I have 3 sheets in the worksheet and i want, while the first sheet remains active, to create ranges in the second one.
I'm using the following code that creates no errors no matter how i use it but it works only if the second sheet is active.
View 10 Replies
View Related
Oct 19, 2009
I have a currently working macro to copy the current sheet as values and create a new workbook in the same folder destination. That code is as follows:
View 10 Replies
View Related
Dec 10, 2009
i created list in Excel and i wrote into (a1 cell-income, b1 cell-expence, c1 cell-kredit and d1 cell-debet). i enter a2 cell income (for ex:1000) and b2 cell expence (for ex: 100) and I give condition in VBA that if income greater than expence then VBA writes a2.value-b2.value into d2 cell else if expence greater than income then it writes b2.value-a2.value into c2 cell but i only define this one row (for ex: c2, a2. b2. d2).
i would like to assign it the rows as long as i want
that is i would like to create loop
(for ex: a(i), b(i) and so on
here is
View 3 Replies
View Related
Feb 3, 2014
.How do you create a popup windows which shows cells on another worksheet that you can change the values based upon a index / match or vlookup?
I select a cell that has a vaule of 102.
then Popups a box which matches that 102 range in another worksheet and shows pulldown (yes no). (Theres about 5 cells (side by side) of yes no pulldowns.
I want the user to then select the values they want and close the popup box.
User selects the following cell with 103. and then goes thru the same process.
View 3 Replies
View Related
Jul 8, 2014
I'm working with some diagnostic messages produced by a communications network, and trying to isolate a certain kind of message. There are many different types of messages contained in the error logs, and I need to look at different ones at different times. As a single log may contain thousands of messages, I'm trying to use VBA to grab the ones I want. The easy part is that these logs can be exported as CSV files.
Each message contains an identifier which I can use for finding the correct messages of a given type. (I'm only looking for one type at a time.) However, this identifier is not on the first line of the message; it's buried a few lines down, and the number of lines is variable. Additionally, the length of the message is variable. The good news is, all messages of interest start with the same text string, and all of them end with another consistent text string. It looks something like this:
Message Start
blah
blah
Message Type
blah
blah
Message End
(Where "blah" is useful information that varies, and the number of lines of blah varies.)
The Message Start string is constant across all message types, as is the Message End string, so I can't use them to find the correct Message Type. However, they are still useful for marking the start and end of each message.
I'm using the find function to find the correct message type, then another find (going up) to get the start of the message, and putting the row number into a variable (msgStartRow). Then I find again for the end of message (msgEndRow).
That all works just fine.
What I can't figure out is how to turn those message row numbers into a range that can then be copied and pasted onto a separate worksheet.
How can I use these variables to copy the correct range? For example, this is what I recorded manually, but it's not intelligent. It can't accommodate different message lengths:
Code:
ActiveCell.Offset(6, 0).Range("A1:A145").Select
Selection.Copy
View 6 Replies
View Related
Feb 17, 2007
I would like to create a named range in VBA for column A, which is a sum of B and C. The problem is that A can have 0 as a value. What I would really like to do is define the named range in column A as A2 to the last column with a value in column B(B10) which would make the named range in column a A2:A10.
ABC
61555560
00
1250120050
725725
00
850850
1919
7216720016
995995....
View 2 Replies
View Related
Jan 2, 2008
I would like to create a range name when the vendor changes in column "A' and identify the range name as the name in "A".
Name Item QTY
Bill A 2
Charley C 1
Charley d 6
Charley z 7
David x 6
David f 44
I would have range name Bill for B2:C2 Charley B3:c4. Since the data changes, I need to have the program run and delete old name and create a new range with new data.
View 2 Replies
View Related
Sep 21, 2012
My range("C4") has the time "10:00 AM". The field has been formated to DATE format. With my code to create an Outlook appointment, I can get all of my required fields to populate from the spreadsheet except for the time. I would like to populate the time for the appointment with the data in C4.
View 1 Replies
View Related
Jul 8, 2014
I have created a spreadsheet which uses data validation to allow a user to select a company, start Date, end date, and projected months in order to output different figures. I have attached a spreadsheet to this post in case that was hard to understand.
Since there is data validation, indexing, and matching going on, as different selections are made, various tables change as a result. Uou will be able to see what I mean as you open the example sheet and start messing around with the data validation boxes.
The problem I am encountering now, is creating an exponential graph that will also keep changing as the user changes their selections in the data validation boxes. I am unsure if this is even possible, but I figured it was worth a shot to ask. On the example sheet, I have included a graph similar to the one I want, but it only contains data in a certain range of cells, rather than dynamically changing to accommodate whatever data is outputted.
Here is what I am looking for in the graph:
1. Whatever dates are selected by the user in the data validation boxes, along with the projected dates will be on the x-axis.
2. The PMPM figures associated with the selected dates, and the projected dates on the y-axis.
3. Ability to make different selections from the data validation boxes and still have a dynamic chart that keeps updating itself.
View 1 Replies
View Related
Dec 5, 2008
I have a worksheet with 500 rows. Coulmn A is all the dates of the items. Is it possible to somehow havea userform or something that I input a start date and a finish date and it only shows me that info.?
View 2 Replies
View Related
Jan 21, 2009
See the attached example. I have data listed as shown, but need the chart to automatically update whenever a new sales figure is added to the next month. I know you have to use the OFFSET to create dynamic ranges but I can't get it to work horizontally, only if my data is laid out vertically.
View 2 Replies
View Related
Mar 18, 2014
I have a list of dates and need to define every 7 days as a week starting a week 1 and descending numerically. I'm doing this as a set up for an INDEX, MATCH function I'm going to write.
I have attached a sample of what I'm trying to achieve
Starting in A2 are a list of dates, starting in B4 I have week 1 listed and want the week 1 listed for the first 7 rows, then week 2 for the next 7 rows, then week 3 and so on.
Trying to figure out an easy way to automate this process so I don't have to type the week, copy it to the next 6 cells and go down the list that way.
View 3 Replies
View Related
Feb 14, 2009
to copy column C and D, from row 3 to the end, from sheet2,in sheet1, column A and B, starting with row 2 and after that I need to create a border to the copied values and I need to create a border to the empty cell from column C.
open attached file
View 14 Replies
View Related
Jun 2, 2009
I have a list of references in a range (A5:A98) in a worksheet called "Architectural". What I am trying to do is create a seperate worksheet based on each cell value in the range. However, rather than blank worksheets, I would like each new worksheet to be a copy of a worksheet called "Template". If possible, I would like to have the name of each worksheet also put into cell B2 of each copy.
View 2 Replies
View Related
Dec 21, 2011
I have file contains two worksheets. 1st worksheet named "list" and the 2nd one named "Template". I have a range in WS "List" let say a1:d20 that contains names. This range is not fix, it might be more or less. I need creating new worksheet using worksheet "Template" for the new sheets in the mentioned range as follow:
"Create new worksheet for each name in this range."
List is not unique, some names are duplicated. If the name repeated, create only one. Use worksheet template for each new worksheet created.
View 2 Replies
View Related
Mar 20, 2012
I am trying to write a simple macro to create a chart over the used range in a worksheet. The first part of the macro correctly selects the used range which in this case is A1 to F19 when I single step through the macro. A listing of the macro is shown below:
Code:
Sub AddChartObject()
'
Sheets("Sheet1").Activate
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
[Code]...
When I place the formula given in MyArea as an argument for the source data, I receive a syntax error, so obviously it is the wrong argument. Numerous attempts to correct it also failed. As a sanity check, I placed the used range in an argument for the source data and was able to create the expected chart. fix the syntax error in the macro
View 4 Replies
View Related
Sep 11, 2012
Is it possible to create a string with a range of numbers
1
3
4
5
6
8
10
Result: 1,3:6,8,10
Or
1
2
3
4
Result: 1:4
Or
1
3
5
7
Result: 1,3,5,7
Where consecutive numbers are separated by a ":" and other numbers by a ",". I use the following function to create the ","-concatenate, but I don't know how to create the ":"-ranges.
Function AConcat(a As Variant, Optional Sep As String = "") As String
'By Harlan Grove, March 2002
Dim Y As Variant
If TypeOf a Is Range Then
For Each Y In a.Cells
[Code] .........
View 9 Replies
View Related