Selecting From Point X To End, And Sliding ActiveCell Over Or Down

Nov 4, 2008

I'm really sorry to keep bothering this board, but I'm trying to get all my basics down and finish up this project! I have two last issues, and I'm sure they're both simple for those of you who knows this language well. 1) Is there a way I can easily select a range from the active cell until the end of that column or row. For instance, instead of:

View 2 Replies


ADVERTISEMENT

Range(activecell, Activecell.end(xlright)).copy

Apr 6, 2007

Does this code copy all cells from the active cell up to the last non-blank cell, or is it up to the first blank cell after the last non-blank cell?

View 9 Replies View Related

Automatically Change The Point Name To Match The Point Name In Column

Dec 10, 2008

I have a pivot table as shown below which is pretty straight forward however I am trying to create a macro that will automatically change the point name to match the point name in column E then copy that resulting dispaly to another sheet then pick the next point name in line and do the same thing and repeat for 50 rows, so my end result will be 50 pivot tables ready for printing. I can do this manually but I am trying to make it automatic...BTW the point names in column E change everyday but the pivot table supports the name changes.

Option Explicit
Sub PointName()
Dim Ws As Worksheet
Dim Rng As Range, Cel As Range

Set Ws = ActiveSheet
Set Rng = Range(Cells(2, 7), Cells(Rows.Count, 7).End(xlUp))

For Each Cel In Rng
Ws.PivotTables("PivotTable1").PivotFields("Point Name").CurrentPage = Cel & " "

Ws.Columns("A:B").Copy
Sheets.Add
With ActiveSheet
.Paste
.Name = Trim(Cel)
.Range("A1").Select
End With
Next
Ws.Activate
End Sub

I turned it off for a while and when I turned it back on I am getting an error
Unable to set the _Default property of the PivotItem class

Debugger is highlighting

Ws.PivotTables("PivotTable1").PivotFields("Point Name").CurrentPage = Cel & " "

View 9 Replies View Related

Sliding Tax Function

Jun 22, 2007

I want to make a function via macro to calculate tax During search I have found a code but the result is not coming correctly.

Tax rate is:

Upto 110000 > 0%

More than 110000 but less than 150000 > 10%

More than 150000 but less than 250000 > 4000 + 20%

Above 250000 > 24000 + 30%

For checking I am providing some solution:
IncomeTax Payable
110000 > 0
130000 > 2000
150000 > 4000
160000 > 6000
250000 > 24000
490000 > 96000

The function is:

Public Function tax(income As Single)
Select Case income
Case Is <= 110000
tax = 0
Case Is <= 150000
tax = (150000 - 110000) * 0.1
Case Is <= 250000
tax = (250000 - 150000) * 0.2 + 4000
Case Else
tax = (income - 250000) * 0.3 + 24000
End Select
End Function

View 5 Replies View Related

Sliding Percentage Scale

Jun 18, 2014

A set low number of 100 is in cell B4, and a related set high percent of 18% is in cell B6.

A set high number of 1,000 is in cell D4, and a related set low percent of 14% is in cell D6.

In cell B8 a manual number will be typed between 100 and 1,000.

In cell B10 we want a formula that will roundup a percentage number between 14% and 18% depending on the number inserted in B8.

View 7 Replies View Related

IF Statements- SLIDING SCALE

Oct 3, 2008

I AM TRYING TO WRITE A FORMULAE BASED ON THE FOLLOWING SLIDING SCALE.

0 - 49.99 = 9.9%
50 - 599.99 = FIRST 50 @ 9.9% (4.95) THEN AT 5.8%
600 ABOVE = FIRST 50 @ 9.9% (4.95) + 50 - 599.99@5.8 (32.45) AND THEN 600 ABOVE AT 1.9%

this is what i came up with, but it is not excepting the formulae.

=IF((C4

View 9 Replies View Related

Sliding Mile Consept

Sep 17, 2009

I need to create sliding function. The inputs are always different and I need to make it capture exactly 5280feet at each step down. And in that distance calculate number of dwellings( which is entered manualy), number of dwellings is necessary to determine class location. There is 3 classes and I think I will have to use nested IF function! (up to 10, from 11 to 45. 45 nad more). Distances between dweldings are different every time! Main challenge is to make it capture only given distanve every time, and calculate number of presented dweldings whithin that captured distance!

View 14 Replies View Related

Calculate On Sliding Scale

Nov 19, 2006

Calculate the intensives to be paid to a loan officer based on the number of cases he brings , according to the following :

the first 10 cases 0
from 11 to 15 cases 6 pounds
from 16 to 20 cases 8 pounds
from 21 cases to more 10 pounds

so I need to put the total number of the cases , the loan officer brought in one cell, and this value to be processed and splitted to the segments above , and multiplied with adjacent pounds sums , and finally calculate the total of theintensive to be paid.

View 9 Replies View Related

Calculate A Linear Sliding Scale

Oct 9, 2008

I need a formula to calculate a linear sliding scale from 10%-30% (no higher, no lower). Based on the data in the below chart, if the GROR (let's say this is known and the result resides in cell A1) is less than or equal to 0.0% the payout % is 10.0% and gradually increases as the GROR increases.

The payout % is capped at 30% which is if GROR is 18% or greater. Below are just some examples of how certain thresholds should calculate.

GROR 0.0%5.0% 8.0% 11.0% 14.0% 18.0%+
payout %10.0%10.0%14.6%19.2%23.8%30.0%

View 2 Replies View Related

Sliding Scale - Figure Increases And Moves Through Thresholds Pay Changes?

Jul 18, 2013

I have a single figure and as the figure increases and moves through thresholds the pay changes. e.g.

Number of sales payable = 15.66
Level 1: 1-10 pays 100 for each that falls in this threshold
Level 2:11-15 pays 150 for each that falls in this threshold
Level 3: 16-20 pays 200 for each that falls in this threshold
Level 4: 21+ pays 250 for all above this

I want to work the amount payable with a formula.

It should be $1849

Is there a formula that can calcualte this without me manually figuring out how many in each threshold.

View 3 Replies View Related

Calculate Total Pay Based On Sliding Percentage Scale

May 20, 2008

I am trying to set up a spreadsheet where all the sales manager will have to do is input the number of cars sold to determine what the total amount of commission will be for a salesperson. I have something set up so far, but need the spread sheet to do an if/then type thing where it will search the table, and produce the dollar amount for the number of cars sold based on the scale and the number in the # cars sold cell.

I've tried conditional sum, IF, goal seek, and all kinds of stuff to no avail. The spreadsheet is attached.

View 7 Replies View Related

Selecting All Data In Specific Columns Without Selecting Adjacent Column

Mar 10, 2014

Using VBA, I need to Select A1:C14.

The problem is that A1:C14 contains blank cells, and there is also an adjacent column D that I do not want to copy.

So, UsedRegion and CurrentRegion aren't doing it for me. (It selects Column D too.)

Obviously, this is an example...the real data set is an export and varies in size.

View 1 Replies View Related

ActiveCell

Dec 18, 2006

Here's the situation:

I want to search through the cells in a column to locate text in one of the cells. If this text is found, I want to make that the ActiveCell and then insert a row underneath it. If this particular text is not found, I want to insert a row and put that text that wasnt found into the first cell in the created row.

I trimmed down my code a lot so I could post it here.

So, in this particular case, once the user selects one of two product lines (named "ADC" and "DAC"), I want to first search for that text and if it is found I want that to be the new activecell and insert a new row.

The main problem is that I can't seem to figure out how to set the "Foundcell" as being the new active cell. My initial activecell is set by locating and selecting the cell containing the text "Product Line".

Here's my

View 10 Replies View Related

Select Activecell And Following

Aug 7, 2009

How can I select the current activecell and the next 50 following rows of that column? I cannot define a range since it has to variable.

View 4 Replies View Related

ActiveCell.Activate...

Nov 23, 2009

ActiveCell.Activate. I'm reading through a VBA book and one line of code was

View 4 Replies View Related

ActiveCell.Offset

Jan 1, 2010

I want to use the following command but with more to it:

X=0
Y=0
Z=10
ActiveCell.Offset(rowOffset:=X, columnOffset:=Y).Activate

I want to use this type of command to highlight an area...not just move rows/columns. I want it to highlight from a point on the sheet marked by X and Y and then down Z rows.

So if I'm in cell A1 and want to highight from A1 down to A10, I'm not sure how to write that part of the code.

View 9 Replies View Related

Losing ActiveCell Value

May 30, 2006

I have a list of line entries for which I need to insert a variable amount of empty lines per line. (the variable amounts listed in a column to the right of my Active Row.

Unfortunatly I loose the ActiveCell's Value. During Debug it shows the correct cell and value, but after the Debug Step Over, the value shows 0 again. I include my
[code]

Sub IP_Insert_rows()
'
' IP_Insert_rows Macro
' Macro recorded 2006/05/29 by Joseph Clark
'
Dim GrpCtrVar As Integer
Dim LnCtrVar As Integer

GrpCtrVar = 3
LnCtrVar = Range("B8").Value

View 4 Replies View Related

Looping With ActiveCell

Jul 1, 2006

I am working on a sub that will populate a cell based on the values of two other cells.

The ws is of variable length, the columns are A through I. I have the logic done, now I need help with the looping. It only loops through the first row. I believe that my problem is something to do with declaring the ActiveCell and looping with that. Also should I use variable names rather than Range(A2) ex. Dim EMUNCD As Variant
EMUNCD = Range("H2").Value

I have the following code so far

Sub MainMgrRpt()

Dim LstRow As Long
LstRow = Cells(Rows.Count, 1).End(xlUp).Row
For Row_counter = 2 To LstRow

Dim planCase As String
planCase = Range("F2").Value

View 3 Replies View Related

Set Print Area Using Activecell

Oct 7, 2012

Goal is to select range from active cell ( where coursos is ) to the top of that row. For some reason

ActiveSheet.PageSetup.PrintArea = Range("xey1":ActiveCell())

Does not work?

View 3 Replies View Related

Identify Activecell Of A Shape?

May 24, 2014

I have put a rectangle shape in a cell in excel. The shape is within the border of a particular cell.

Is there a way to find the reference of the cell on which that particular shape resides.

For example, I have kept a rectangle shape in cell F5. I was looking for a macro which would return the cell reference "F5" in which the shape resides.

View 6 Replies View Related

Get Listbox Selection Into The ActiveCell?

Apr 26, 2014

On Select cell F6 my list box appear, however once an item is selected form the listbox, i cannot get it to appear in the active cell (F6).

code and where to place it to make this work

View 10 Replies View Related

ActiveCell And Command Button

Mar 5, 2009

I have a spreadsheet that automatically analyzes the last week's worth of data and then displays a table of summary data from that analysis in the range C2:G11. Each row (i.e. 2:11) represents the statistics from one of the 10 regions in the state. I then have a second "details" table which remains blank (it occupies the range C14:G20; one row for each day of the week) until an "x" is typed in Column H in the cell adjacent to a region's summary data above, e.g.

if I want to display detailed data for region 4 for the last week, I would type an "x" in cell H5; formulas in the blank "details" table then lookup information on region 4 from a larger dataset. This system works fine, but is a little clumsy (typing "x"'s and deleting previous "x"'s, etc.).

Here's what I would like:

1): A macro for this sheet that will place an "x" in the ActiveCell (only in the case that the active cell is somewhere in the range H2:H11), will remove that "x" when that cell is no longer active, and will not place more than one "x" at a time-- for instance if more than one cell is accidentally highlighted

2): Also, I would like to be able to paste the values and formatting of the "details" table (C14:G20) to a separate sheet (we'll call it Sheet2) if they're interesting, and I'd like to be able to do this with a command button. The problem is I don't know... 1: how to place a button on the sheet, 2: how to attach code to this button, 3: where to place this code (can it go in the same place as the ActiveCell macro I described earlier?).

Ideally, the code would allow me to paste an arbitrary number of these tables to Sheet2, so the code would need to be able to identify the first blank cell in Column A as the location to paste a new table when the button is clicked.

View 2 Replies View Related

Mouse Relocation To ActiveCell

Nov 20, 2009

I've got an application where I switch between workSheets and the mouse stays in the same location. As all of my actions are predicated on mouse right-clicks or double-clicks, the first thing that I have to do as move the mouse back to the active cell. Is there a way to reposition the mouse to the activeCell upon returning to the workSheet?

View 6 Replies View Related

ActiveCell Falls Within A Specified Range

Apr 25, 2007

I want my code to verify that the Active Cell on a worksheet falls within a specified range of cells before the sub fires off.

View 9 Replies View Related

ACtiveCell.row: Active Row Is Empty

Jun 9, 2007

I am trying to write a statement that sees if the the row below the active row is empty.

I have written the following but it is wrong. Please can someone correct it for me? Thanks!

If IsEmpty(ActiveCell.Row.Offset(1, 0)) = False Then
MsgBox "Not Empty"
End If

View 9 Replies View Related

Activecell/deactivate A Cell

Jan 21, 2009

is it possible to deactivate an activecell?

the following code works well i have a range of cells(e1:o17) i click on one of those cells to enter a score into (a2) the next cell i click enters a score into (b2) ok so far but if i need to enter the same score consecutively as needs to be done from time to time i cant do it because the cell is still active.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Range("d1") = Range("d1") + 1
If Range("D1") = 2 Then Range("a2") = ActiveCell.Value: Range("c2") = 501 - Range("a2")
If Range("D1") = 3 Then Range("a3") = ActiveCell.Value: Range("c3") = Range("c2") - Range("a3")
If Range("D1") = 4 Then Range("a4") = ActiveCell.Value: Range("c4") = Range("c3") - Range("a4")
If Range("D1") = 5 Then Range("a5") = ActiveCell.Value: Range("c5") = Range("c4") - Range("a5")

View 9 Replies View Related

Copy ActiveCell OnChange

Sep 24, 2009

I am trying to copy the active cell from a range on sheet 1 to a new sheet ( Sheet 2 )in the next available row of Column B ONLY if the value changes from being blank.

If it was not empty I dont want it to be copied.

I cant seem to get my onChange event to copy anything.

View 9 Replies View Related

Way To Use ActiveCell In Median Formula?

Oct 23, 2009

In Excel VBA, is there any way to use ActiveCell in Median Formula?

E. G. Range("A5").Formula="=Median(ActiveCell.d5). Say ActiveCell already
defined as Range("D2").Select or Activate.

VBA doesn't accept this method. Any other way to use other than R1C1 direct address in the use of Median formula?

View 7 Replies View Related

Delete TextBox That Is Placed On The Activecell

Sep 23, 2004

How to select the TextBox that is placed on the activecell without referencing
to the TextBox number i.e ( TextBox1 ) I reached this code, but it is with the textbox number………sometimes I want to delete the TextBox that is placed on the activecell, so the user doesn't know the number of the textbox that is placed on the activecell………

ActiveSheet.Shapes("TextBox1").Select
Selection.Delete

View 7 Replies View Related

Copy Range & Keep ActiveCell The Same

Aug 16, 2007

trying to make a copy range of cells from an activecell.

My activecell is P9 and I want to copy the contents of P1 to P18 without losing P9 as the activecell.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved