# Range Selection And Origination Difficulty

Nov 3, 2008

I may not have the terminology right, but here's my problem:

With the Range Select Formula i.e.

## Difficulty Deleting Blank Rows

May 6, 2008

I am copying a range of rows from one sheet to another.

The rang consists of 11 rows; the first and last will always have data in them but the rest may or may not. Consequently, there are always a number of blank rows which I want to delete...

## Difficulty With IMPOWER() Worksheet Function

Jun 7, 2008

1) The cubic root of complex numbers "x+yi" are calculated using IMPOWER().
The w/s function appears to return incorrect values when the coefficients of the complex number are -ve.

2) For example:
A1:: -8+0i
B1::= IMPOWER(A1,1/3)
the function returns: 1. + 1.7320508i
instead of the correct value of -2.

3) The problem appears to be consistent with calculating theta [=atan(y/x)] as "pi" instead of "0" for the above example "-8+0i"

## Difficulty Adding IF To INDEX MATCH

Sep 15, 2009

I have a formula that currently works on it's own as a array formula, however I need to integrate an IF statement into it. I tried this, and the result shows a blank cell (it should be blank only if false), but the data reflects a true statement.

{=IF(Client!\$D\$9="Scale 10",INDEX('Base Model'!\$K\$3:\$K\$237,MATCH(1,(\$B3='Base Model'!\$A\$3:\$A\$237)*(\$E3='Base Model'!\$E\$3:\$E\$237)*(\$D3='Base Model'!\$D\$3:\$D\$237)*(\$C3='Base Model'!\$C\$3:\$C\$237),0)),"")}

Client!\$D\$9 is a formula, and currently the result is Scale 10.

My attempt is that if the statement is true, the INDEX MATCH should be calculated and populate the result, and if the statement is false, then the cell should display a blank result.

## Difficulty With IF Function For Cells Containing Both Numbers And Letters?

Feb 1, 2013

I have a sheet with part numbers, costs and wish to add varying number to the cost in each row, based on a certain aspect of the part number:

A
B
C

[Code].....

In the example, 01/1X/2X/3X are the differentiating aspects of the part number. To rows in column A containing 01 (preceding the dash) I want to add nothing, 1X+.75,2X+1.5,3X+9.

I have researched the nested IF formula and can use it in a test as long as column A contains either numbers or letters. The problem I have is because there is both numbers and letters, the logical argument won't validate "if true". Here is my formula (omitting my attempts with parenthesis etc. around the letter in the logical argument):

=IF(IF(A1=1X,B1+.75,IF(A1=2X,B1+1.5,IF(A1=3X,B1+9,B1)))

## Difficulty Adding Minimum And Maximum Values To Existing Formula?

Mar 12, 2014

I'm currently using the following formula to return values rounded down to the nearest 2.5: =FLOOR(X8*1.25,2.5)

This works fine but I would like to put in place a system where if the "X8" value is 1 the formula produces a 2.5, and if the "X8" value is 10 or greater the formula produces a 10.

## Excel 2010 :: Difficulty Breaking Link Possibly Caused By Name Function

Sep 11, 2013

I have researched a problem I am experiencing in Excel 2010 and have had problems in the past with previous versions. It seems that occasionally I run across a link that just refuses to break. During my research I have found some reports that this may be linked to the "Name" function. !!!Bing!!! the light comes on. When I copied my template to my new folder and tried to cut and paste data into it I got a message saying something like "A formula or sheet you want to move or copy contains the name "...", which already exists on the destination worksheet." and I opted to replace the existing name with the new one.

Apparently I created an external link at that point and one that cannot now be broken unless I delete my named range and start over the naming process. I mention this here because I see lots of people having this problem and the stock answer is to goto the Edit Links menu and attempt to break the link. Try as they and I might, this doesn't work. I also saw a post about it being a phantom validation problem and that too panned out although I can see how the validation could be linked externally and create this problem.

Does this accurately describes the issue and is there a remedy besides re-creating the "Names"?

## Difficulty Writing Code For Changing Font Color If Cell Contains Specific Text

Aug 11, 2009

I have a spreadsheet that will contain about 5-15 rows with a letter "S" in the column. If this letter S appears in the column, I need its entire row to change font color to RED and then change that row's value in column L to a negative number. is there any easy way to do this?

Jul 22, 2009

A question regarding "AboutRangeSelection" procedure on Chapter 11 in the **, Excel 2003 Power Programming with VBA by John Walkenbach.

## Deriving Range From A Selection

Jan 20, 2010

I am trying to figure out how to derive a range from a selection. Here is the code i am using to select the table.

## Range Selection With Variable

Jan 27, 2010

I am using Selection.ClearContents command to clear data from column F and G. I know the last row as 230 but the starting row is the first empty cell which I find using Do While loop in range F31 to F230. The variable that stores the first empty cell number is 'r'.

Range("F &r:G230").Select
Selection.ClearContents

## Dynamic Range Selection

Feb 8, 2010

I am filtering a list in Column H and depending on what criteria I filter on I need to be able to select only what I have actually filtered for. I am using the code below to find the lower right corner of my range that I'm trying to select and this works great.

## If Range Selection Does Not Match Value Then

Mar 7, 2012

VBA IF statement that references the below code. the IF statement would say if the below selection does NOT match 'putname' then

Code:
Range(Selection, Selection.End(xlDown)).Select

## Cell Selection Over Given Range

Apr 8, 2014

I'm looking to go to every 8th cell in a column when I hit the enter key. I was thinking of selecting a small range say from A2 which is zero to A10 which would also be zero then A18 which is zero. The reason being I have a lot of figures to put in to each zero cell then I select "Series" to fill the cells in-between with the incremental figures between the two zeros which would be the difference between the two zero figures.

## If Statement With A Range Selection

Aug 9, 2007

I was making a simple spreadsheet as I'm taking practice tests for some IT certifications and the spreadsheet I was making was to chart out my progress.

I had a range of scores in some cells and one of the formulas I used so that I didnt have errors in the sheet like div/0 went like the following:

=if(b5:b50="","",sum(b5:b50)) this seemed to work really well for the one section, however I tried to get a little fancy as always and I think I messed something up. Beneath that I tried to separate each practice test with the same sort of formula resulting something like the following:

=if(b30:b40="","",sum(b30:b40)) this however just returned an error #value. I dont understand why the first formula worked and the second didnt. Then again, I'm not really an excel guru, back in college I was really good with it but I dont really remember much.

## Range Selection Query

Feb 27, 2009

I'm writing a couple of macros which require selection of a range. The user could either select the range before executing the macro or if range has not been pre-selected, an inputbox should pop-up through which the user can select required range.

## Chart With X-Axis Range Selection

Feb 26, 2014

I have excel file and need to create a chart with X axis to be scalable, by selecting (from drop down menu) - start and end dates.

## Selection Of Range For The 'slope' Function

Dec 20, 2008

Here is what I'm trying to do:

1) I have column labels, and row labels on one worksheet which I input into
a function.

2) These inputs should be matched with column and row labels, and then input
into the index function to get a certain cell - let's call it the event cell.

I'm ok with this part. Then:

3) I would like to collect a one column array. The number of cells in this
array should depend on an input from a cell in the worksheet, and the final
cell in the array should be the column label of the column where I am
inputing the formula.

4) The array from 3) should go into the slope function.

5) Then I want to get the second array for the slope function from a fixed
column, but the same rows as in the variable first array, and this should
input into the function.

## Move Range Selection By Two Columns

Nov 19, 2009

I have a spreadsheet with data organized into columns in sets of two - the first column is an X value (Pixel number) and the second column is the Y value (pixel density). I'm trying to make a macro that will select the first set of columns, chart it, move the chart to the next sheet, then select the next two columns of data, chart them and move the chart to the next sheet etc. I've gotten as far as having it make the chart and move it, but I can't seem to make it select the next set of columns - I've been trying different things for a couple days now.
Code:

## Range With (Center Across Selection) Cells In It

Jan 30, 2012

I am trying to use Range.Find in a named range that has some areas where two cells are merged using the format "Center Across Selection"

Set rngTemp = wbMaster.Range("PnLDateRow").Find(what:=dDate)

I get a run time error 438 "Object doesn't support this property or method"

Is it not possible to use this method to find the cell in this range? I tried iterating through the range but that errors also.

## VBA For Selecting A Range To Fill A Selection?

Aug 27, 2012

I have to run reports every week where I show the number of days items are pending some sort of action. I use an autofill action in a macro but the number of rows changes every week. Here is the current section of my macro that I use. I just input a row number that I know will not exceed the number of rows required by my data (12900). What can I replace this with (Selection.AutoFill Destination:=Range("J2:J12900") so it will only fill the number of rows current filled in in either row I or K?

Range("J2").Select ActiveCell.FormulaR1C1 = "=R1C19-RC[-1]" Selection.AutoFill Destination:=Range("J2:J12900") Range("J1").Select Selection.Copy Columns("J:J").Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=FalseApplication.CutCopyMode = False

I have a date in cell s1 that I subtract from the date in row "I". I then copy the result of row J and paste it as values.

## Deleting Particular Sheet / Range Or Selection

Oct 2, 2012

Any easy way of finding out if deleting a particular sheet / range or selection will mess up any references elsewhere in the workbook?

## Smart Range Selection In Macro

May 22, 2013

Im having some problems with range selection in macros. Basically, what the macro does is Copy / Paste as Values in differet sectors of an active worksheet, so this is the code for each range of cells that I need to copy paste:

Code:

ActiveSheet.Range("C14:E15").Select
Selection.Copy
ActiveSheet.Range("C14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

The problem with this code, is that because it specifies EXACTLY which range to select, if I add a row before that range the macro will be now selecting an incorrect range.

For example, say I have a value on cell A5, and the macro is set up to copy/paste that cell. Later on, I decide to add a row in A3, so the value I would need to copy/paste will now be in A6, but the macro will still execute on A5 (incorrect, as it should now execute in A6, and that is what I have to manually correct each time).

## Macro To Run On A Dynamic Selection Range

Oct 13, 2008

I am looking to run a marco for a selection range, and the selection range could vary in size.
Using the Macro recorded (whilst turning on the relative reference) the Macro runs for a defined number of cells. I would like to run certain Macro, for different ranges of cells.

## Delete Row Based On Range Selection

Oct 14, 2008

Here is my
ThisWorkbook.sheets("sheet1").Range("M").Select
For Each cell In Selection
If cell.Value = ThisWorkbook.Sheets("Sheet2").Range("A").Value Then
cell.EntireRow.Delete
End If
Next cell
Range("a1").Select
End Sub

I want to remove all rows in sheet 1 that contain any value found in Sheet2 A I using XL 2003.

## Change Range Selection With A Variable

Feb 19, 2009

How do I change the selection of a range with a variable, and not a hardcoded number in XL2003? I have to update a set of spreadsheets every month, and it's a hassle to have to constantly open my pivot table worksheet, copy, open the summary worksheet, paste ... etc. etc. etc. The code below is my attempt at creating a ComboBox with "January, February, March, etc." and every time I select a particular month it will automatically copy data from my pivot table worksheet into my new summary worksheet in the correct column. The range of data from my pivot table worksheet will never change, so I have no problem hardcoding that in, but based on which month is selected will alter which column the data goes in in the new worksheet.

I want to be able to write code for one month (say January) and then when I want to use a different month (say February) I can just change the column number and call up the originial January code.

Private Sub ComboBox1_Change()
Dim ColNum ' This is the variable I want to change based on which month is called
If ComboBox1.Value = "January" Then
ColNum = 1 ' Column number for Column A- Where my January column is
Elseif ComboBox1.Value = "February" Then
ColNum = 2 ' Column number for Column B- Where my February column is
' etc. etc. for each month
End If
Call January
End Sub

Private Sub January()
' Just a quick msgbox to make sure the previous macro is calling this one
MsgBox "Is this macro running?", vbQuestion + vbYesNo, "Check"...........................

## Dynamic Range Selection For Charting

May 7, 2009

I have three rows that each attempt to pull in data from a range on different worksheets. All but one return nothing but "#N/A" values. The one row returns values from the proper range. (User selections determine which row will have data).

Second, I successfully pull data from the row containing actual information into another row, using the following formula: "=OFFSET(E\$36,CHOOSE(\$Y\$1,0,1,2),0)" on a cell-to-cell basis. The value in \$Y\$1 chooses the row to look at, based upon a dropdown selected on another worksheet.

So I now have a row with =OFFSET(E\$36,CHOOSE(\$Y\$1,0,1,2),0),=OFFSET(F\$36,CHOOSE(\$Y\$1,0,1,2),0),=OFFSET(G\$36,CHOOSE(\$Y\$1,0,1,2),0) and so forth. I can find the last value in the row, but I cannot find a way to extract the address from that, and create a table that will use as a series the last 26 values in the row.

For reference, I use "=LOOKUP(9.99999999999999E+307,E49:FD49)" to determine the last cell with a value (gleaned from a Dueling Excel Youtube Video, - very helpful!).

I hope the above will be clear enough, but if not, I'll be happy to provide additional information / clarification.

## VBA Dynamic Range Selection Failure

Aug 3, 2009

I have a log that I use to keep track of my hours where the days hours and charge numbers get summed and moved to a new sheet via a command button. One of the categories is week ending date. I want the week ending date cells to merge if they match and cannot get the range I want to highlight. I can move the data, find and define the first and last cells in the range, but can't get the range.select command to work. I think it is just a syntax error, as I am new to VBA.

I can open a Locals window and watch it assign values to myFirstCell and myLastCell of "\$A\$36" and "\$A\$44" respectively, but I get an error on either the set range= or range.select lines.

My code is as follows:

Private Sub Post_Hours_To_Log_Click()
'Posts the day's hours to the hours tracker.

Dim myFirstCell, myLastCell As Variant

Dim myRange As Variant

***Removed N/A code that goes to another sheet and decides which data to copy***
Application.Goto reference:=Worksheets("Hours Log").Range("A2"), _
Scroll:=False

## Prevent Shape & Range Selection

Dec 7, 2006

I have put a 3d shape on the excel sheet, and would like it unclickable. Is there way to accomplish that with the sheet still clickable. I know that you can use protection from Tools manual to protect the sheet. Is there way to protect just specific object or range of cell unclickable?

## List Range Names In Selection

Oct 11, 2007

want a list of the defined names in a selection. So lets say the range is "A1 to G60". I would like the to see a list of each cells name and the associated address.