VBA Refuses To Change Cells

Aug 23, 2008

I'm trying to clear one set of cells when a change is detected in another, but my VBA function refuses to change the cell values.

Attached is a stripped-down version of the sheet & code which manifests this problem.

The affected cells are unlocked etc, and the code is correct -- at least, it correctly gets to the proper range (or cells) on which to call (in my various attempts) ClearContents, .value="", etc. So the problem is not the algorhithm passing the variables but in the specific attempt to change a sheet's cells' values.

View 14 Replies


ADVERTISEMENT

VBA Routine Refuses To Change Cells

Aug 23, 2008

I've posted the simple sheet elsewhere and others report that the sheet and routine works fine for them. The exact same sheet that is failing for me.

The algorhithm itself works for me too - everything is parsed correctly and the proper range successfully receives the .ClearContents command. It's just that, on my sheet, nothing happens.

I have the entire book and sheet unprotected, all the cells unlocked, and permission for all macros to run. I.e. I've removed every possible "excel-level" roadblock I can think of. I've tried restarting Excel, even rebooting -- all with no luck. The page still doesn't work.

What other possible settings might be causing the consistent failure when I try to run the sheet whereas other users (reportedly) have no such problem with my VBA routine and their identical copy of my sheet?

Private Sub Worksheet_Change(ByVal Target As Range)

Dim n As Long
Dim clearTable As String
Dim clearTrigger As String
Dim clearRegion As String

With ActiveSheet

clearTable = Range("ClearRegions").Text ' Get clear table.................

View 9 Replies View Related

Refuses To Calculate A Formula!

Jul 20, 2009

I have a spreadsheet that I was sent (with some resource calculations on it - nothing major or huge) and I have added a sheet to it. The issue is that, on the existing sheets, any formula I add works but on the new sheet - they don't!. I get on the new sheet is the formula written out in the cell:

=vlookup(b2,table,2,false) rather than the answer

I have
- looked at the formula and it is correct
- cut and paste all sheets (values only) into a new sheet
- had a look in the VBA window - nothing stood out

View 2 Replies View Related

Option Button Refuses To Work

Apr 12, 2008

All I want to do is create a group of 3 option buttons in an excel worksheet for a user to select one of two farm programs or none. (CIG or MRP or None) When a user makes a selection either CIG or MRP or None appears in a designated cell. I even used code in the VB editor help but it only shows how to operate one button (which is absurd.) I found an example using 2 buttons, but that wouldn't work either. Found a tutorial using 3 buttons and that wouldn't work. Is this a conspiracy? Every time I try to find help to do something simple in excel lately I hit a brick wall.

View 9 Replies View Related

Date & Time - Date Refuses To Dissapear

Sep 8, 2009

I am attempting to create a Spreadsheet which, when double clicking on a cell, loads up a Userform, has some times entered, calculates the difference and submits any overtime done.

I've had no problems doing the userform and the related coding to do the calculations. However, when I want to enter a time without the date (For example 0900), no matter how I do this the date always appears at the top in the formula bar.

I have tried http://www.cpearson.com/excel/DateTimeEntry.htm
to no avail, even when I just used this code in a blank workbook it still returns the date when I enter 1700 for example. And I have made sure the cell is formatted in "hh:mm:ss".

So, what is driving me stir crazy is why on earth my Excel is not letting me just enter times without colons and returning a date, no matter the formatting.

View 9 Replies View Related

Linking Cells Globally To Allow Users Ability To Change Cells On Separate Sheet / Cells?

Feb 18, 2014

I have a workbook that uses the values that a user had entered into 3 cells to calculate multiple other charts/diagrams on multiple sheets within the workbook. Each sheet would show what the user had entered in the 3 cells to allow them to see what is being used to calculate each table. Is it possible to link these cells so that the user can change the 3 values without having to go back to where he originally entered the 3 values?

For example, a user has entered in 3 values in Sheet 1. A formula in Sheet 2 displays what is entered by the user and uses these calls in Sheet 2 for calculations. When the user wants to change the three values, he would have to navigate to Sheet 1 and enter in the new values to have the workbook recalculate all the tables. Is there a way to link the three cells from Sheet 1 and Sheet 2 so when the user is on Sheet 2, he has the opportunity to change the values on the current Sheet without having to navigate to Sheet 1 to do so?

View 1 Replies View Related

Locking Text In Cells But Not The Ability To Change Colour Of Cells With Mouse Click

Mar 5, 2013

Locking text in cells but not the ability to change colour of cells

******** width="234" height="60" frameborder="0" marginwidth="0"
marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" id="aswift_0" name="aswift_0" style="left: 0px; position: absolute; top: 0px;">*********>

I have a spreadsheet where I can change the colour of a cell by clicking the mouse, I also have text in many of the cells.

What I need to do is protect (lock) the text so that no one can change the text in any of the cells, but I still want to be able to change the colour of the cells by clicking the mouse in that cell.

View 2 Replies View Related

Change Empty Cells To Blank Cells (need To Use Skip Blanks Function)

Mar 8, 2014

I have a spreadsheet where a column has many cells being empty and others with values. I need to use copy-paste skip blanks to another column so it only overwrites cells that contains values. BUT The cells in the column appears to be empty, not blank, when I try use the copy-paste skip blanks it doesnt work. However, when I press delete in every empty cell the copy-paste skip blanks works for those cells.

Do you got a fast method to make all the empty cells blank?

View 4 Replies View Related

Date Cells In Project Plan To Change Based On Other Cells Including Other Date Cells

Oct 31, 2008

This is a project plan with tasks and dates. Column A is the activity number. (Example 1, 2, 3" etc). Column B is the task (Ex. "Complete Report"). Column C is number of days required to complete the task. Column D is the dependency column. (Ex. Cell D2 =1 in other words Task 2 is dependent on task 1). Column E is the date.

I would like to have a seperate start date cell and a go live date cell.

The objective is to enter a start date, and have each column E date increase based on the number of days entered in Column C. If a task is dependent on another and I change the number of days in Column C I need the dependent task to change the same amount of days.

View 9 Replies View Related

Change Color Of Group Of Cells Based On Data In Another Group Of Cells

Jan 12, 2014

Conditional formatting. I want to change the color of a group of cells based on data in another group of cells. Example:

If cells G8 and G9 (which are merged) are between 80% and 94%, then I9,I10,I11 (which are merged) will turn Yellow. Also, under the same scenario, IF G8 and G9 is greater than 94%, then cells I9, I10, I11 will turn Red.

View 2 Replies View Related

Highlight Change In Cells?

May 16, 2014

I have a sheet that I have item numbers in a column that i want to highlight and change color when they are not the same. I want the colors to be unique to each number. I am currently using conditional formatting (Format cells based on their values (3-color scale)). I works alright but not perfect.

condition formatting.PNG

View 2 Replies View Related

Cells Need To Change Colour

Oct 23, 2008

I have developed a profit loss sheet for the office I work for. What i need is to have either cells change colour or the numbers in the cell change colour depening on the value in the cell.

What I was thinking is if the number is over 15% of the sale price the cell or number should be green, if the number is under 15% it should be black, and if its below 0% it will be red.

View 4 Replies View Related

Change Cells If Colored (vba)

Jul 9, 2009

I've got two adjacent columns. D and E.

I want to do the following for each row (starting from row 2) :
If D is empty and E has a grey background color - I want the value from E to be copied to D.

I'm very new to VBA, so I don't really know how the syntax works.
This is what I've got so far ^^


Public Sub ReplaceIfColor()
If ((Range(2, E).Interior.ColorIndex = 15) & (Range(2, D)=0)) Then
.Replace D.Value, rngCell.Offset(, 1).Value, LookAt:=xlWhole

View 11 Replies View Related

Change Cells Using Command

May 30, 2006

I am trying to Change Multiple cell values using the command button. So once clicked it should change the value in the cells with the value its getting from the Inputbox. This function also changes the cells in multiple worksheets. For some reason its not working and I can't figure the problem out.

Private Sub DateChngButton1_Click()
Dim strDate As Date
Sheets("Summary").Select
strDate = InputBox("Input the date eg. april 2004", Title:="Date Change Prompt")
Range("H4").Select
ActiveCell.FormulaR1C1 = strDate
Range("I18").Select
ActiveCell.FormulaR1C1 = strDate
Range("I32").Select
ActiveCell.FormulaR1C1 = strDate
Range("I46").Select
ActiveCell.FormulaR1C1 = strDate
Sheets("Cover").Select
'strDate = InputBox("Input the date eg. april 2004", Title:="Date Change Prompt")
Range("C22").Select
ActiveCell.FormulaR1C1 = strDate
End Sub

View 2 Replies View Related

Change Layout Of Data Within Cells?

May 5, 2013

I need to change the layout of data within a cells. Attached is a sample of what I need to do

View 9 Replies View Related

Revalidate All Cells Validation On Any Change?

Apr 5, 2013

I've got many cells with validation set up, but the validation is dependent on other cells in the worksheet which can change.

The validation works as long as I go through each cell systematically, but if I'm at the bottom and change one value in an earlier row, the other cells aren't re-validated. Is there a way to force the worksheet to re-validate any cell that has validation upon any change in the worksheet?

View 2 Replies View Related

Monitor Specific Cells For Change

May 8, 2014

I have this code that works well for the entire column, but, I only need to monitor every other cell in the columns. the cells I want to monitor are:

B10, 12, 14...B96. the columns to be monitored are B,F,J,N,R. the column part is good. I don't want the pop up box to appear when I change B9, B11, B13 etc...

View 6 Replies View Related

Change Colour Of Certain Cells When Condition Met

Jul 31, 2014

I am using the following code to amend the colour of a cell when a name is entered in ROW J however, i need it to colour the row from A to O on the line the name is entered on.

So for example Dave is in j2 (j1 is a header) the line from A2 to o2 goes green.

I have tried a few things with interesting results but not get desired result.

[Code] ......

View 4 Replies View Related

Use Vlookup To Change Cells Without Scrolling

Nov 12, 2007

if it is possible to change a cell that the vlookup has found without scrolling all the way to that cell.

I have attached a small sample of my workbook. Once the vlookup has found the item I would like to change the number in G5 and make it change the number below in the OUT column that corresponds with the found item.

Example:
row 11 is found with vlookup. i want to be able to change G5 to the number 8which will make G11 the number 8. And then make it stay even after i have done vlookup on another item.

I believe this will require a VBA code. Also I am using Excel 2007. I have added a test page. It is saved in 2007 format. If anyone needs it saved in 2003 please ask.

View 9 Replies View Related

Change Cells With Text And/or Null To Zero

Feb 28, 2009

I have a large worksheet that has one column that contains cells with either numbers, text or in some cases Nulls. Can anyone help me with some code that would loop through all the cells in this column and when it encounters either text (any text) or a null change the cell value to 0 (Zero).

View 10 Replies View Related

Change Array To Include New Cells

Aug 14, 2009

I am having a ton of trouble with this. I am trying to add a single text row in between existing data. I have tried multiple loops to try to place an array into Column G, but I cannot figure it out. Is there some coding that will produce the sort of result below in column G?

View 6 Replies View Related

How Do I Change Time Frames In Cells

Oct 12, 2009

I have a column that has time ranges in it. Example: Column N Row 6 thru
253 has the following time ranges: 11am-1pm, 1pm-3pm, 12pm-5pm, 8am-12pm

I need cells with 11am-1pm to read 13:00
I need cells with 1pm-3pm to read 15:00
I need cells with 12pm-5pm to read 17:00

Is there a formula that I can use the look up the entire column and make all the changes at once, or do I have to use the find a replace. The correct format can appear in a different column.

** I found a reply for someone one a different website with the similar problem. Below is the response but it did not work for me.

Try this formula =--SUBSTITUTE(SUBSTITUTE(MID(A6,FIND("-",A6)+1,11),"pm"," pm"),"am"," am")

Also change format to show 13:30 timeframe

View 14 Replies View Related

Change 2 Numbers In One Cell To Two Different Cells?

Sep 23, 2011

I imported a bunch of data that has some of the numbers listed as this 50-55.

what is the forumla to change it some both numbers are in different cells.

View 6 Replies View Related

Change Format Of Cells To Time Value

Oct 15, 2011

I have a consolidated sheet which I maintain to keep track of the scores of my team. Unfortunately from time to time, the format of all the cells is getting changed to "time" value. I do sometimes use an addin which I have downloaded from Straxx.com (excel password remover) and I am not sure if this add-in has anything to do with this.

I am having to change the format of almost 20+ columns every time this happens.

View 1 Replies View Related

Change Font For Cells With Formulas?

May 20, 2012

I am looking for the best way to change the font of cells in a Worksheet that contain a formula. I have used Go To-Special-Formulas but have one slight problem with this method. It highlights all cells that contain an "=" sign. Some cells may be linked (ie cell A2 may say =cell A1). How would I change the font only for cells with a Function such as Sum or Vlookup and not for cells that simply link to another cell?

View 7 Replies View Related

Locate Blue Cells In Col F Then CHANGE Value To 0% Using VBA

Dec 17, 2013

Need VBA code to start with row 5 and look through COL F for any blue cells, IF=BLUE change the percent to 0% for that cell.

The RGB color code for this particular shade of blue is: Red 153, Green 204, Blue 255.

View 2 Replies View Related

Change Multiple Cells To Array?

Feb 11, 2014

I have 68 cells per sheet and approximately 70 sheets that i need to change to an array function.

Ive changed the formula used using Find and replace but now I need to convert ALL those cells to array.

Is there something I can use to change them all at once. Or am i going to have to go into each cell and F2 CTRL SHFT ENTER?

View 5 Replies View Related

Change Color Of Certain Cells If Value Of A Cell Is Y/N

Apr 4, 2014

I am working on a code in which i have to change the color of certain cells if the value of a cell is Y/N. The color should change with the user input.

Set wsheet = wbook.Worksheets("XYZ")
For Row_start=10 to Row_count 'Row count is the last used row in the worksheet
RowValue = ActiveCell.Row
colValue = ActiveCell.Column
if colValue = 17

[Code] ....

View 1 Replies View Related

Pop-Up Message When Cell Value Changes And Not When Other Cells Change

Jun 11, 2014

I want to create a pop-up message for two of the cells that contain a formula. Cell A10 counts dates entered in column A for the current calendar year. E10 totals the hours and minutes in column E. I was able to create the following code:

Private Sub Worksheet_Calculate()
If Range("A10").Value > 3 Then MsgBox "Employee has reached the tardy threshold. Contact HR Coordinator."
If Range("E10").Value > 2.667 Then MsgBox "Employee has reached the 64-hour threshold for sick leave. Contact HR Coordinator. If employee provides medical verification, enter hours over 64, using calculator on the right, in a new row under the Pre-Approved and Authorized Absences section."
End Sub

I would like it to pop up when the total is => a certain value. I would not like it to pop up if data in other cells outside that column is entered (right now it seems to pop up once the condition is met everywhere on the sheet). If the user deletes rows and it makes the total < the certain value, I would not like it to pop up, but if the user adds more data again to make the total => the value, I would like it to pop up again. This is a dynamic, ever-changing sheet, but I am not sure how to make it work this way.

View 3 Replies View Related

Insert Rows At Change In Cells

Nov 21, 2006

I have a large file that has the following setup
2003 Zipper X
2004 Zipper X
2005 Zipper X
2003 Zipper Z
2004 Zipper Z
2005 Zipper Z
How can I insert rows at changes in the product description

View 9 Replies View Related







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