Select a range of cells using ActiveCell
I am trying to select a range of cells using ActiveCell.Offset
This is really testing me, up to now I have this:-
Private Sub CommandButton1_Click()
Windows("example.xls").Activate
With Worksheets("Data").Range("C1:C65536")
Set c = .Find("", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Select
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Start_Point = ActiveCell.Address
ActiveCell.Select
ActiveCell.Offset(rowOffset:=-50, columnOffset:=0).Activate
ActiveCell.Select
End Sub
I want to select the last 50 cells in column C
Please help!
Thanks.
Windows("example.xls").Activate
Worksheets("Data").Select
With Worksheets("Data").Range("C1:C65536")
Set c = .Find("", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Select
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Start_Point = ActiveCell.Address
ActiveCell.Select
ActiveCell.Offset(rowOffset:=-50, columnOffset:=0).Activate
ActiveCell.Select
ActiveCell.Offset(0).Resize(50).Select
Selection.Copy
Similar Messages
-
Select a range of cells?
How do I select a range of cells to, say, copy and paste? In Excel I highlighted the cell and at the bottom right corner I clicked on a dark cross and dragged it to the last cell I wanted to highlight. How do I do this in Numbers.? I am in the process of convertin MS Word and Excel files to Pages and Numbers. All comments welcome.
j.,
From the Numbers Help Menu, choose Numbers User Guide and download it.
Jerry -
Selecting particular range of style using script
HI All,
Can anyone suggest me that how we can select the range of text using script.
I am having some different para styles say for eg., PS1, PS2, PS3, PS4...........
I may applyed these styles in some jumping order but except PS1, now I want to select paragraphs with applied style PS1 to stop before the next appearence of PS1 style.
Like: In a document Para 1, 10, 14, 25 were applied with PS1, so the selection should go in the way like 1-9, 10-13, 14-24 and so on
Regards,
love_all"The" index of a paragraph is nothing special, it's the index of the first character of that paragraph inside its parent story. In particular, it does NOT tell you "this is the 5th paragraph" or something like that.
This is because "Paragraph" is an artificial construct inside "Text", not a truly existing first class object. Same as "Line", "Word", "Character", and indeed, any text selection at all.
Since you already have a "found text" array, "the index" of the nth entry's paragraph -- with the constraint described above -- can be simply found by using foundText[n].paragraphs[0].index (the index of the first character of your foundText is foundText[n].index).
If you DO need to know the nth number of the paragraph, search this forum. I think Peter Kahrel answered to a post to answer that exact question. -
How do I select a range of numbers using IF function
I am trying to select a name in a cell if the value of another cell is either a 5,6,7,8 or 9. I have had success when I have just wanted numbers above 9 or below 5 by using formulas
IF(Table 1::C3<5,T(Table 1::A3),T(Table 1::A2))
And
IF(Table 1::C3>9,T(Table 1::A3),T(Table 1::A2))
But for the life of me can't get the range of numbers in between.
I have tried including AND and OR functions in multiple ways but to no success. I know I am overlooking some simple thing, I have tried scratching for nested if functions but no help there either, and the information file in numbers is horrendously useless.
Please help. I am using an ipad btw.This forum is generally for iPad and iOS problems. I doubt that you'll get an answer here.
Furthermore, you don't say what app you are using. If Numbers, you should post here https://discussions.apple.com/community/app_store/iwork_for_ios
Cheers, Tom -
How to make table cell drop down menu from an existing range in cell
Is this possible?? Checked all over the web & coming up empty. Trying to avoid re-typing in contents from previously created tables in the cell format pop-up menu. Please help.
I don't think there is an easy way to do this unless Yvan comes up with a script for you.
One option is to select the range of cells and copy/paste to TextEdit (yes, surprisingly it'll take a range of cells) then from TextEdit you can copy/paste each cell's contents one at a time to the popup menu list. Still a pain but it might be easier than other methods. The workflow I found quickest was to position TextEdit near the Inspector pane (which is open to the Cell inspector with your popup in it) and have the top of the Numbers window nearby. Double click on one cell's contents in TextEdit then Cmd-C to copy, click on the Numbers window up in the toolbar to make Numbers active again without selecting a different cell, then put the contents in the inspector (hit + then paste with Cmd-V). Repeat.
Message was edited by: Badunit -
I'm working on a sheet that I want to use to select a specific part based on values created by the sum of values in other cells. I am down to the point where I need to select a low range of numbers
If the sum of cell D5 equals any sum between 1-15 will equal = part 1
If the sum of cell D5 equals any sum between 16-23 will equal = part 2 ,
If the sum of cell D5 equal antsy sum between 24-32 will equal part 3.
I'm at a loss how to make one formula or combination of formulas do this.
Thanks in advance.
Big Al HurHi Al,
The confusion arises from your having asked two separate questions, one in the subject line, the other in the body of your initial post.
1.
How do I sum only the values greater than zero and less than 7 in a range of cells?
This formula supplied by SGIII does what you have asked there:
=SUMIFS(A,A,">0",A,"<7")
The syntax is:
SUMIFS(sum-values, test-values, condition, test-values, condition…)
sum-values ( A ) is the range of cells containing the values to be summed (all the body cells in column A)
test-values and condition come in pairs. the first names the range of values to be tested, the second names the condition that must be met.
In this formula, the test-values in each pair are the same as the sum values.
condition ( ">0" ) is the first condition that must be met by these values. (greater than zero)
the second condition ( "<7" ) is the second condition that must be met (less than seven)
To be included in the sum, a value in the list must meet both conditions: It must be greater than 0 AND less than 7. IN SG's example, there are two values that meet both conditions, 2 in A2 and 6 in A5, that meet both conditions. Their sum, 8, is shown in A10, whch is the cell containing the formula.
2
If the sum of cell D5 equals any sum between 1-15 will equal = part 1
If the sum of cell D5 equals any sum between 16-23 will equal = part 2 ,
If the sum of cell D5 equals any sum between 24-32 will equal part 3.
This formula supplied by SGIII, and the Lookup table that goes with it, does what you have asked here.
=VLOOKUP(D5,Lookup::A:B,2,close-match)
Close-match means 'the largest value that is less than or equal to' the search-value.
The search-value is the value in D5
VLOOKUP searches in the leftmost column (A) of the lookup table (columns A and B of the table named Lookup).
With "close-match" specified:
any value that is equal to or greater than 0 and less than 16 will be matched by the 0 in A2. VLOOKUP will return the value in the same row of column 2 (B) of the table: "Part 1"
any value that is equal to or greater than 16 and less than 24 will be matched by the 16 in A3. VLOOKUP will return the value in the same row of column 2 (B) of the table: "Part 2"
any value that is equal to or greater than 24 will be matched by the 24 in A4. VLOOKUP will return the value in the same row of column 2 (B) of the table: "Part 3"
While this is not an exact match with your description above, it will perform exactly as you requested IF the value in D5 is never less than 1 and never greater than 32.
If the possible range is greater than that, I would suggest the changes shown below to the formula and to the lookup table. The column containing numbers is column D, and represents values in D5. Column E shows the result for each value using the given formula and lookup table (LU A). Column F shows results for the same values using the revised formula and lookup tble (LU B):
Original =VLOOKUP(D,LU A :: A:B,2,1)
Revised formula: =IFERROR(VLOOKUP(D,LU B :: A:B,2,1),"N//A")
In the revision, IFERROR takes care of the negative values in D2 and D3. The zero value in D4 and in the last row of column D and the overflow values (greater than 32) are handled by the revisions to the lookup table.
Regards,
Barry -
Numbers Select a large range of cells
I select a cell to enter a formula. The key board pops up and I select the Average function. I then try to select a large range of cells, but unable to do so because the Numbers screen will not scroll. I select the cell directly above the keyboard, but when I move my finger up to select 25 rows, I can only move up about 6 rows.
This is using Numbers on an iPad. What advice can you give me for correcting my error.
ThanksHere is an answer that worked great for me. I found it here:
Concatenating a Range in Excel
You'll have to adapt it for your spreadsheet:
A
B
(result)
1
Apple
2
Baker
=A1&A2
AppleBaker
3
Charlie
=B2&C1
AppleBakerCharlie
4
Denver
=B3&C2
AppleBakerCharlieDenver
5
Edward
(etc.)
You just concatenate two cells together (using the '&' concatenation operator), and then in the next cell you just add on to the end of the result. So that by the end, you have them all in one long string.
You might say "But I have to write out all those formulas". No. As you know, you can just copy the formula to the next cell and Numbers will change the references for you. -
I am attempting to have cells use data from a selective month from the year before so that I can show actual from the prio. year each month. I need to create a spreedsheet using the the Acutlas from the year-to-date and from last year-to-date, but need to report each month.
Hi Tony,
Answering your question would be easier given a screen shot of the source table and one of what you want the summary table to look like.
Is the data you want for each month in a single cell o the source table, or does the summary table need to collect February's data (for example) from several cells and do some math with those numbers before presenting them on the summary table?
Regards,
Barry -
Select a range of rows to be displayed using ROWNUM
I am trying to select a range of records to be displayed using Rownum
It works using MINUS
SQL> select rownum,department_id,department_name from departments where rownum <= 20
minus
select rownum,department_id,department_name from departments where rownum < 11;
but does not work if a range is specified
select rownum,department_id,department_name from departments where rownum >= 11 and rownum <= 20;
What has gone wrong?
Details of what I have tried are as follows:
Connect to the sample schema HR
SQL> connect hr/hr
SQL> desc departments
Name Null? Type
DEPARTMENT_ID NOT NULL NUMBER(4)
DEPARTMENT_NAME NOT NULL VARCHAR2(30)
MANAGER_ID NUMBER(6)
LOCATION_ID NUMBER(4)
List all records in Departments
SQL> select rownum,department_id,department_name from departments;
ROWNUM DEPARTMENT_ID DEPARTMENT_NAME
1 10 Administration
2 20 Marketing
3 30 Purchasing
4 40 Human Resources
etc......
26 260 Recruiting
27 270 Payroll
27 rows selected.
List the first 10 records in DEPARTMENTS
SQL> select rownum,department_id,department_name from departments where rownum <= 10;
ROWNUM DEPARTMENT_ID DEPARTMENT_NAME
1 10 Administration
2 20 Marketing
etc.....
10 100 Finance
List row number from 11 to 20, but cannot no rows selected. Why?
SQL> select rownum,department_id,department_name from departments where rownum >= 11 and rownum <= 20;
no rows selected
Use of MINUS can retrieve row number from 11 to 20
SQL> select rownum,department_id,department_name from departments where rownum <= 20
minus
select rownum,department_id,department_name from departments where rownum < 11;
ROWNUM DEPARTMENT_ID DEPARTMENT_NAME
11 110 Accounting
12 120 Treasury
13 130 Corporate Tax
14 140 Control And Credit
15 150 Shareholder Services
16 160 Benefits
17 170 Manufacturing
18 180 Construction
19 190 Contracting
20 200 Operations
10 rows selected.For each row returned by a query, the ROWNUM pseudocolumn returns a number indicating the order in which Oracle selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1, the second has 2, and so on.
Conditions testing for ROWNUM values greater than a positive integer are always false. For example, this query returns no rows:
SELECT * FROM employees
WHERE ROWNUM > 1;
You can get the selected records based on the rownum using the inline query....
SQL> select rownum, empno from emp;
ROWNUM EMPNO
1 7369
2 7499
3 7521
4 7566
5 7654
6 7698
7 7782
8 7788
9 7839
10 7844
11 7876
ROWNUM EMPNO
12 7900
13 7902
14 7934
14 rows selected.
SQL> select * from (select rownum rn, empno from emp) where rn > 2 and rn < 5;
RN EMPNO
3 7521
4 7566 -
"Select Color Range" not working. "Warning: No pixels were selected" returned when attempting to use. Using Photoshop CS6 on a Mac running OS X Yosemite
Here are three screenshots in succession from trying to perform the color selection:
Dropbox - Screenshot 2015-02-12 14.57.40.png
Dropbox - Screenshot 2015-02-12 15.00.14(2).png
Dropbox - Screenshot 2015-02-12 15.01.00.png -
How do I select a range of values in MySQL using a drop down menu
Hi,
I have a database of picture frames that have a value of
frame width. I want to be able to select a range of values (i.e.
.50" to 1") instead of each and every value (i.e. .50", .56", .76",
etc.). I have a drop down menu (mnuWidth) with 5 ranges (see
attached code).
Each selection has a value from 1 to 5 indicating the range I
want to search. In my results page I have let DW set up a recordset
(see attached code)
Can anyone tell me how to get this to choose a range instead
of just the value entered by my menu?
Thanks in advance.
TomI have been growing fond of lookup tables. Your lookup table would have your numbers in one column and the values you want returned in the next.
Lookup table
item
Name
1
a
2
b
3
c
4
d
5
e
6
f
7
g
8
h
9
i
Input table
input
Name
1
a
B2 and copied down:
LOOKUP(A2,lookup::$A$2:$A$11,lookup::$B$2:$B$11)
Caution: Lookup will return the closest value so it it looks for "10" in this example it will return "i"
If you don't want to see the error messages from blank inputs, wrap Lookup in IFERROR.
hope this helps
q -
Creating a pop-down using a range of cells (Like Excel LIST feature)
Can this be done in numbers. Instead of typing the data into a pop-up list to be pasted in an ongoing long spreadsheet, I was wondering if Numbers supports a similiar feature to Excel's MANAGE LISTS which allows the drop down to be locked to a range of cells instead. I know they are very similar, but wondering?
-KevinKevin,
Presently Drop-Down menu's can't be created from cell ranges in Numbers. It sounds like a good feature, and has been asked about many times here. You can Send Feedback to the Numbers team and tell them what you would like to see in the next version of Numbers. The Feedback link is under the Numbers menu item.
Jerry -
Sub CopyPasteEntries()
Dim i, g, h As Integer
i = 2
Sheets("Sheet1").Select
Do Until IsEmpty(Cells(i, 1))
i = i + 1
Loop
g = i - 1
h = 2
For i = 2 To g
Sheets("Sheet1").Select
If Cells(i, 1).Value <> "Created" Then 'first cell
Cells(i, 1).EntireRow.Copy
Sheets("Sheet2").Select
Cells(h, 1).Select
ActiveCell.PasteSpecial xlPasteAll
h = h + 1
End If
Next
Application.CutCopyMode = False
End SubInstead of
Cells(i, 1).EntireRow.Copy
use any of these
Cells(i, 1).Resize(1,11).Copy 'A to K
Intersect(Cells(i,
1).EntireRow, Range("A:K")).Copy
Range(Cells(i, 1), Cells(i,11)).Copy
Range(Cells(i, "A"), Cells(i,"K")).Copy
Range("A" & i & ":K" & i).Copy
Cells(i, 1).Range("A1:K1").Copy -
XML/XPath question--how to select a range of elements with XPath?
Hi there,
I have an XML DOM in memory. I need to do hold it and issue only parts of it to my client app in "pages". Each page would be a self-contained XML doc, but would be a subset of the original doc. So for instance the first page is top-level elements 1-5. 2nd page would be 6-10 etc. Is this solution best solved with XPath? If not, what's the best way? If so, I have the following question:
Is there a way to use XPath to select a range of nodes based on position within the document? I know I can do an XPath query that will return a single Node based on position. So for example if I wanted the first node in some XML Book Catalog I could do XPathAPI.selectSingleNode(doc, "/Catalog/Book[position()=1]"); I could wrap the previous call in a loop, replacing the numeric literal each time, but that seems horribly inefficient.
Any ideas? Thanks much in advance!
Toby BuckleyYour question is about marking a range of cells. 99% of the code posted has nothing to do with this. If you want to create a simple table for test purposes then just do:
JTable table = new JTable(10, 5);
JScrollPane scrollPane = new JScrollPane( table );
getContentPane().add( scrollPane );
In three line of code you have a simple demo program.
When I leave the mouse button again, these bunch/range of cells shall stay "marked". table.setCellSelectionEnabled( true );
and I'd like to obtain, say, a vector of a vector containing just those data marked beforeUse the getSelectedRows() and getSelectedColumns() methods for this information. I would suggest you create a Point object to reflect the row/column position and then add the point to an ArrayList. -
Problem: "Select a Range" doesn't work (Cannot mark data from MS Excel)
Hi,
I need Your help. I have some problem with connection with MS Excel.
I can't use MS Excel range as data source.
Please find short overview of this situation (video clip):
[http://www.explorer-consulting.pl/XC-prob.swf|http://www.explorer-consulting.pl/XC-prob.swf]
(Windows 7 + Office 2007).
Maybe there is something to do w/ Windows 7 admin options, but I have no idea what kind of them.
Please share Your ideas.
WojtekHi Liliana,
about video (it's flash swf file) so maybe You have to give permission to watch this (in Your browser).
but here You are screenshot too:
[http://www.explorer-consulting.pl/xc.jpg|http://www.explorer-consulting.pl/xc.jpg]
XC 2008 servicepack3 with fixpacks 3.1, 3.2, 3.3 and 3.4
I try to select cells in Excel area, but "Select a Range" window is blank all the time.
Edited by: WojciechKorsak on Jan 31, 2011 7:38 PM
Maybe you are looking for
-
Can't edit ipod (add/delete songs/playlists)
I rebooted my pc with my 30gb 5th gen. ipod still connected. The next time I plugged in my ipod a pop up box came on and asked if I wanted to set up my ipod (as if it were a different ipod). the first time it happened I said no and the ipod worked as
-
Ibot to PDF Error: Not enough rendering area (SOLVED)
FYI Problema: [nQSError: 77006] Oracle BI Presentation Server Error: A fatal error occurred while processing the request. The server responded with: A fatal error occurred while processing the request. The server responded with: Error while executing
-
Synchronous messages for SOAP adapter.
Hi All, I wanna expose an interface in XI as a WebService.My requirement is to invoke a webservice which takes some input and hands it over to a DataBase and gets something from it(DB) and hands it over to the application which had called this WebSer
-
Restricted key figures (from Infoprovider) not showing in multiprovider
Hi all I have created a multi provider joining two info providers. The infoproviders have many restricted and calculated key figures. Do I have to re-create these in the multiprovider ? In the infoprovider when I click on edit restricted key figure
-
Where 's the type of System Landscape Directory in Technical System ?
Hi experts: when I configured the name server, I create a Technical System in sld which type should be System Landscape Directory . But this time i faced urgent problem, i can not find the type of System Landscape Directory in the Technical Syste