Define When A User Selects Specific Multiple Cells

Nov 24, 2008

My worksheet with macros gets messed up when a user selects either multiple cells from column F or selects multiple cells in any one row (but only if column F is included) in the range C17:O116 and hits "delete". I will either do an exit sub, an application.redo, or something similar so that this doesn't happen, but I don't know how to write the code to trigger these events. So I need a way to determine "if the user selects multiple cells in column F and hits delete" or "if a user selects multiple cells in any row from 17 to 116 that includes the cell in row F, and hits "delete.""

Set Rng = Range("F17:F116")
Set rng2 = Range("K17:K116")
Set Rng3 = Range("L17:L116")

View 3 Replies


ADVERTISEMENT

ActivatE Calendar When A User Selects A Specific Cell

Jan 29, 2009

I'm wondering if someone can help me with this. I am using the excel calendar control and trying to activate it when a user selects a specific cell "C3". I can get it to activate when I move off the cell, but it's not working when they click on the cell.

Sheet1
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("C3")) Then
Call OpenCalendar
MsgBox "Calendar"
End If
End Sub

Userform2 (I have this code under here)...............................

View 9 Replies View Related

Sum The Cells In B According To What The User Selects From The Drop Down

Oct 8, 2009

Say you have two columns, A & B. Each cell in column A consists of an identical drop-down menu of four possible choices. Each cell in B is a random number. I want to sum the cells in B according to what the user selects from the drop down in column A. If A1=A2="BILL", I want the sheet to add B1 and B2. IF A1=A3="BILL", and A2=A4=TOM, I want the sheet to sum B1 and B3, then sum A2 and A4. So, conceptually, I guess column A acts as a group identifier, and I want to sum B by group.

View 2 Replies View Related

User Define Function To Count Bold Cells

Oct 16, 2007

I currently have this macro that helps me SUM all the cells that are bold.


Public Function SumBold(Rng As Range)

Dim Total As Double
Dim Cell As Object

Application.Volatile
For Each Cell In Rng
If Cell.Font.Bold Then Total = Total + Cell.Value
Next
SumBold = Total

End Function

I want to have the same kind of Macro, but that could COUNT the number of cells that are Bold.

View 9 Replies View Related

Paste Date And Time When User Selects From Dropdown

Nov 29, 2011

The code below adds the date to D:D once the user enters data in B:B and then adds the time when the user selects from a dropdown in C:C. When they have finished the task they enter anything into F:F and then it enters the end time in G:G.

This works well except for one flaw and one modification that I can't get to work. I have found that people retrospectively change the activity in C:C which causes the start time to change. I would like to avoid this hapenning if possible by putting some code in to stop this. Also I would like the times to be related to the push of a button on the sheet and therefore need different code.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("B2:B900")) Is Nothing Then
With Target(1, 3)
.Value = Date

[Code] ......

View 3 Replies View Related

Ensure User Selects Radio Button Before Adding Information

May 27, 2014

I have a userform for inputting information to a spreadsheet using the code below. It works fine however if the user does not select a radio button to select a score its saving the rest without it. How can I ensure the user selects a score,,,, ob10, ob8, ob6, ob4, ob2, obna.

[Code] ......

View 2 Replies View Related

Message To Apear It The User Selects A Year AND Month Less Than The Current Year

Sep 25, 2006

I have two combo boxes: One for entering the Year, and one for the month. I can produce a message if the user leaves either box blank but I want a message to apear it the user selects a year AND month less than the current year (iYear) and current month (iMonth). I therefore need an AND statement between the two criteria but i dont know how to do it.

'....First Checks the Comboboxes arent blank then below Checks a future month/year secection is chosen

ElseIf YearBox.Value = iYear & iMonthbox < iMonth Then
MsgBox ("You may not enter Data before the current Month")
Else '...... Run main code here

View 3 Replies View Related

Excel 2003 :: Macro To Open Folder Then User Selects File Then Macro Continues To Run

Nov 6, 2011

I use Excel 2003 at work. I'm looking for some code that will Open a folder and then lets the user to select a file then continues to run the macro.

The file name they select will look similar to this K2271011.504 or K3011111.201

View 3 Replies View Related

Select User Define Page Size

Apr 22, 2006

how do i print on a3 paper? i can't find the option anywhere...i can select user define size but then where do i define it?!? i know this is a silly questions

View 3 Replies View Related

Checkbox That Selects Multiple Checkboxes

Aug 9, 2007

I have a worksheet with approx. 100 form checkboxes. The cell behind each box holds it's TRUE/FALSE condition, which is something I check for elsewhere on another worksheet.

I need one 'SELECT ALL' checkbox which, when selected, will 'check' every one of these 100 checkboxes (change their conditions to TRUE).

Ideally this would be done thru an excel formula, but I've looked everwhere and not found anything that will permit this.

View 6 Replies View Related

Import Specific Cells From A User Chosen Spreadsheet

Nov 24, 2009

I need to import some spreadsheets that are sent to me into a master database spreadsheet. I have attached both below. The complaintstest.xls is the master database and the other is the sheet that will be imported. What I would like to happen is when the macro is run, the user will be able to select the sheet they would like to import through a dialog box. After the sheet is selected the macro will import the cells from the selected sheet into the master database in a particular order. In the master database example on row 2 I have listed the columns from the sheet to be imported in the corresponding column on the database sheet. This will macro will be run a couple of times a week so the macro will have to find the next empty row to start the import on.

View 14 Replies View Related

Changing The Color Of A Command Button :: To User Define Colors

Jan 29, 2009

so I know how to change the color of a command button(right click, properties), but is there a way to change the color to a specific red green blue range? lets say 102 28 02 for example

View 2 Replies View Related

Protect Sheet But Allow User To Unhide Specific Range Of Cells

Jul 19, 2014

All, can I protect my worksheet while at the same time allow users to unhide a specific range of cells?

I'm hiding cell range FA:FK, but based on certain conditions I want to allow the user to unhide the cells but I do not want the user to be able to unhide any other hidden ranges. if there is a way to do this without using VBA. If it cannot be done with VBA

View 1 Replies View Related

Define Number Of Decimal Places To Specific Textboxes On Multi Textbox Useform

May 16, 2012

I have a userform with 35 text boxes on which display data from a worksheet based on a selection made from a combobox.

My problem is that TextBox11 and TextBoxes 15-35 all need to show a value to 2 decimal places i.e 360.00.

I have found the following line of code:

Code:

For Each ctrl In Controls
If TypeName(ctrl) = "TextBox" Then ctrl.Value = Format(ctrl.Value, ".00")
Next ctrl

Which does the job but unfortunatley it applies it to every single textbox on the form (not just No's 11,15-35) which is a problem as some of the boxes contain dates so instead of 09/05/2012 i actually get 41038.00.

My question is how to I modifiy the above code (or is there an alternative code?) to only apply to the required textboxes?

View 1 Replies View Related

Comparing Multiple Cells Against A User Defined Entry

Dec 3, 2008

I need of a formula that will look through a list of text strings, spread out through two columns) and compare each one to a user defined entry. When it finds a match against this entry I would then need it to compare another set of text strings on the same row as the entry that it previously matched against.

If it was to find a match on only the original text string it would need to return a true result and if it matched on the original text string and also one of the other text strings on the same rowit would need to return a false result.

I currently have a formula to compare all text strings against the user defined entry and if it is contained in the first 2 columns it returns a true result and if it is contained in both ranges of text strings it returns a false result but i need it to apply the rules per row.

Below is the formula that I am currently using if this helps as a starting point. If you need a subset of the data I can supply this.

Current formula:

=IF(SUM(IF('HBO Frequency Projections.xls'!NOT_HOMEBASED"",IF(ISNUMBER(SEARCH('HBO Frequency Projections.xls'!NOT_HOMEBASED,C5)),1)))>0,"NOT HBO",IF(SUM(IF('HBO Frequency Projections.xls'!HOMEBASED"",IF(ISNUMBER(SEARCH('HBO Frequency Projections.xls'!HOMEBASED,C5)),1)))>0,"HBO","NOT HBO"))

View 9 Replies View Related

Subtracting From Multiple Cells To Get Specific Answer

Mar 11, 2011

I had a question considering a workbook that I am working on for overtime, a different one than I posted before. On my workbook, I have vacation leave, sick leave, and overtime to figure in. I want to be able to have a choice to choose which you would like to keep at the end of the week. Such as if you were to work 8 on Mon, 8 hours on Tues, 10 hours on Wed, and then take vacation leave on Thur, for 8 hours, and then work 6 hours on friday, I need a way to choose whether to be paid for the overtime and vacation time, or to subtract two hours from my overtime and add it to my regular time, i.e. 40 hours, or subtract two hours from my leave time and add it to my regular time. I know this sounds complicated, it is at least to me.

View 3 Replies View Related

Ignoring Specific Values While Selecting Multiple Cells

Dec 20, 2012

I have to correct a spreadsheet that takes a bunch of values and creates an average.

=average(N15;N29;N43;N57;N71;N85;N99;N113;N127;N141;N155;N169;N183;
N197;N211;N225;N241;N255;N269;N283;N301;N315;N329;N343;N357)*100%

I didn't create this. Anyway, the problem is that most of these cells will be empty unless a whole bunch of other stuff is filled. These N cells take several values, put them together and create a new one. As time goes by they are filled. While they aren't filled, they'll return the DIV/0 error.

So when that formula I pasted there uses all of these values, it also returns a DIV/0 error because it is getting info from cells that have this error.

I managed to correct that with this
=averageif(N15:N357;"<>#DIV/0!")*100%

It works like a charm save for one problem. When I use averageif I'm forced to use an interval. Along this interval other values show up (it is always a value ranging from 0 to 2). So when the formula works its magic the results are slightly skewed because of this other value that I don't want.

So I figure there must be two ways around this. The first one would be using something like averageif that lets me use several handpicked cells instead of an interval. If I try

=averageif(N15;N29;N43;N57;N71;N85;N99;N113;N127;N141;N155;N169;N183;
N197;N211;N225;N241;N255;N269;N283;N301;N315;N329;N343;N357;"<>#DIV/0!")*100%

It doesn't work, it says I have too many values. So if I could the exact same thing as I did with averageif but keeping all of these values it'd be super nice.

The other solution, less nice but equally effective I guess, is using this same interval but having more than one criteria. The first criteria would still be the one telling it to ignore DIV/0 error, the second criteria would be the one to ignore any values equal or lower than 2.

View 5 Replies View Related

VBA - Copy Multiple Cells If Specific Text In Row Then Modify

Mar 7, 2012

I want some VBA code that will:

1) automatically check the active row to see if it contains specific text (i dont' care if there is other stuff in the cell or cells), such as "truck 1 blahblahblah" and checks for specific font color, such as green.

2) if the row does, then I want it to copy ALL the cells in the active row EXCEPT Column A (which contains the date), and then paste them twice, one 21 rows down from the active row, and one 35 rows down from the active row.

3) Once copied and pasted, modify the pasted cells slightly. The first pasted cells need to say Truck 2 blahblahblah in Column C and be in blue font (instead of the original Truck 1 blahblahblah in Green Font), the second needs to say Truck 3 blahblahblah and be in yellow font. Everything else that was pasted will be the same EXCEPT they will be in blue or yellow font.

View 2 Replies View Related

Search IF Row Of Data (multiple Cells) Contains Specific Text

Mar 21, 2013

I'm building an inventory report based upon a daily report downloaded from a website. The downloaded report changes from day-to-day. All of the data I need remains there, but the location of the columns changes, with the exception of "BOL". I need to sort all of this data in a macro. I have most of my macro figured out, but I'm having trouble with one "sort". I need the data to be sorted FIRST by whether or not the 4th column contains "Clear" or "Dyed". I have the next two sorts already coded, based on SPOT vs Contract and then numerically by column A. But I cannot find macro coding or an excel formula (either would work) that reliably searches the 2nd column for the word "Clear". I have tried different combinations of IFERROR, FIND, SEARCH, IF, ISNUM, etc. in hopes of writing a new adjacent column containing the values "Clear" and "Dyed". I have found many combinations that work if I search only the correct cell. But when I extend the range to search through ~26 cells in one row, they all fail. Below is a (small) example of what I start with and what I want to end with. I've also included my current relevant Sorting code in my macro.

FinPro

Sup
Veh
1Dn
2Cn
2Dn
Bio
Injec

[code]....

View 5 Replies View Related

Multiple Input Boxes & Output To Specific Cells

Jan 27, 2007

> When the workbook is opened I want a box to appear with a message and 4 choices (as buttons?).

> Based on the button clicked I want 1 of 4 new boxes to appear (replacing the first box) and ask for input values.

>I then want the inputs to be written to specific cells on a specified worksheets inside the workbook.

View 2 Replies View Related

Exl2K User: Sheet Is Password Protected But User Can Change Color In Unlock Cells

Jun 16, 2006

find attached zip file . if you open the file then you can understand the problem.

I need to change cells color and text color as per user choice in Password protected sheet : (user is useing excl2000)

Kindly open attahced file i putted the note inside the file.

View 3 Replies View Related

Define Range By Selected Cells

Jul 19, 2014

I am working on some code to copy data from one sheet to another, but I'm not sure if I'm going about defining the copy range correctly. I would like it so that the user can highlight a range of cells on the sheet between A3 and F last row (last row based on col C). However the user should be able to highlight rows in any column between A and F, and they could highly the records with just one column or multiple columns. It should take the row numbers of the highlighted range and use the that as the row number to extract the data from.

[Code] ........

Im currently getting runtime error 13 on 'CopyRange = Selection.Rows'

'CopyRange = Selection.Row' returns the single row number for the first cell in the selection, but i need the range of all the rows in the selection.

View 6 Replies View Related

Lookup Specific Cells In Multiple Worksheets To Bring Into One Workbook

Aug 13, 2013

I have a workbook that's setup like a form, with 30+ worksheets in it (lets say this file is called "source.xlsx"). I have information in specific cells I want pulled out in each worksheet and brought in to a new workbook called "Destination.xlsx" and listed in a row.

View 2 Replies View Related

Fill Cells With Some Specific Texts Based On Multiple Conditions

Jun 18, 2014

I have a worksheet ("ALL JOBS") with huge row data and the row data will vary every day. My problem is there will be a lot of blank cells which I need to fill manually and its tacking lot of time of mine.

Code to fill these blank cells automatically with some specific texts based on the attached conditions.

I have attached the workbook for more details. FillCellsTest.xlsm‎

View 10 Replies View Related

Macro - Select Multiple Cells By Searching For Specific Text

Nov 8, 2013

I would like to select all cells in column A that begin with the text "SP". Some cells will be contiguous but others will not. For instance in one case, I would like the macro to select cells with the text "SP" which would result in cells A1, A2, A3, A10, A15 being selected. I am working on building a macro that will then do other things to these cells/rows so this is the first step.

The below code will select the first cell with "SP". How would I alter this code to only search Column A and select multiple cells? or totally different code.

Code:
Sub test()
Dim r As RangeSet
r = Cells.Find(what:="SP", LookIn:=xlValues, lookat:=xlWhole)
If Not r Is Nothing Then r.Select
End Sub

View 7 Replies View Related

Define Merged Cells - Before Save Function

Oct 19, 2008

I used this forum to successfully prevent a user from saving a workbook without entering data in a certain cell. However, I now have a merged cell that I must refer to when writing my "before save" code and don't know how to refer to that cell. Below is what I have: One workbook with nine worksheets. The merged cells I want to refer to are H11 and I11 in sheet seven. User RYLO posted the below code that worked for me but I don't know how to alter it to refer to a merged cell.

View 4 Replies View Related

Excel 2003 :: Define Several Incremental Cells Names At Once

Oct 31, 2011

I am trying to rename a row of cells with incremental names. Ex.

A1=Results1, A2=Results2, A3=Results3, ...., AN=ResultsN

Of course, it can be done by setting names for each cell separately but it takes ages. I would like to know if this is possible to do that quickly due to an add-in or VBA.

I use Excel 2003.

View 6 Replies View Related

Define Range Object Based On Cells Not Null

May 20, 2006

The problem that I am having today is defining a range object that cannot include null cells. If it does include Null cells then the filterwill fail. the cells that I need to define are all in a cohesive unit. the other thing to know is that the cells that are not null will never be mixed in with cells that are null. so for instance you might have a range of cells from one to 100, the first 50 might be full. the last 50 would all be null. in that situation I would need to loop through those cells to define a range object that would just see the first 50 cells ....

View 6 Replies View Related

Find Specific Value In Array Which Appears Multiple Times And Average All Relative Cells

Jan 24, 2014

I'd like to search for a specific value like (1) in an array of cells like (A:A). The result needs to be the average number of a different column (B:B) in the same row as the searched value (1). And the resulting number should be rounded up to the nearest 10.

Example below: (Find value = 1 in A:A) ... 1 is found 4 times.

A | B
1 | 295
3 | 123
1 | 400
5 | 425
1 | 354
1 | 400

In the example above there are 4 (1's) found. By adding all the values in column (B) of the same row, we get 295+400+354+400 = 1449, dividing that in 4, the average is 362.25, rounding that up to the nearest 10... THE RESULT I'M LOOKING FOR IS: 370

View 6 Replies View Related

Possible To Define Range For Combobox Input Based On Number Of Non-blank Cells?

Nov 25, 2013

Rather than having to give it a range, I'd like to have a generic range giving me room to add or subtract values in the column without changing this statement.

Code:

Worksheets("Sheet1").Shapes("Combobox2").ControlFormat.ListFillRange = _
"O2:O14"

View 3 Replies View Related







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