Retain Formulas When Deleting

Dec 17, 2006

how do you store formulas so that they stay in the cells when all info is deleted? so i can use the same spreadsheet every week but all i have to do is select all and delete. if i do it now i lose al my formuals.

View 3 Replies


ADVERTISEMENT

Retain Formula Reference When Deleting Rows

Apr 24, 2008

I have on a sheet, on say cell "J10" a formula "=A1"

Now suppose I to delete row 1, Then J9, which was formally J10, will now say "=#REF!" instead of "=A1"

Is there a way to maintain J9 (which was J10) to say "=A1" without giving a reference error?

View 9 Replies View Related

Retain Formulas In A Few Cells In A One Worksheet So They Are Not Cleared By "clear Contents" Without Using Protect Sheet

Apr 8, 2008

i have a worksheet which is a form which feeds into another worksheet which acts as a database. i have a button which clears the form based on code which is essentially "clear contents".

the problem is i have a few cells where i would like to retain the formulas. i tried to do this with custom in validation but this did not work. i also tried to enter the code directly into the worksheet but this didnt work either (my skills are limited..). i am avoiding using protect sheet bc that in turn will affect many of my other buttons. is there something i am overlooking?

View 9 Replies View Related

Deleting Worksheet Causes #REF! In Formulas

Sep 4, 2006

I have a macro that imports a text file. I then have summary sheets that reference to the sheets with the imported text file details. This is a task I complete every month.

The next month I delete the sheets with the imported text file details before importing current month's details. But when I do that it screws up my references.

Here's an example of a reference with previous months' imported text file details:

= SUM('X'!$I$1:$I$3000)/2+SUM('Y'!$I$1:$I$3000)/2

When I delete the sheets with the imported text file details and import current month's details, my reference suddenly looks like this:

=SUM(#REF!$I$1:$I$3000)/2+SUM(#REF!$I$1:$I$3000)/2

What can I do to prevent the summary sheet from messing up my original references?

View 3 Replies View Related

Deleting Cell Values But Not Formulas?

Aug 24, 2013

I work for a bank and we use an excel spreadsheet that has an in depth payment calculator used for creating monthly payment arrangements or calculating settlements on bank loans. I would like to add the following feature and I'm not quite sure exactly how to do it.

For example, imagine cell A1 will contain the full payoff of a loan. I want to be able to put a settlement offer in B1 and have C1 populate the percentage of the payoff that is. At the same time, I want to be able to delete the settlement offer in B1 and put a percentage in C1 and have it calculate that settlement offer in B1. The calculations/formulas to do these problems is simple, but what I need is to not lose the formulas in B1 and C1 if I were to go back and forth entering settlement offers vs settlement percentages.

View 2 Replies View Related

Deleting Rows Without Modifying Formulas

Apr 9, 2009

I have a large amount of data on a sheet which is being looked at by the following formula

{=AVERAGE(IF(LEFT(RAW_DATA!$C$4:$C$10000,LEN(Dashboard!$I$10))=Dashboard!$I$10,IF(RAW_DATA!$A$4:$A$10000=$A2,RAW_DATA!$J $4:$J$10000)))}

However, i don't need to keep the oldest data so I want to write a macro that deletes some of the top rows. Doing this in the normal way causes the formula above to change. I.e deleting one row cause the range to become $J$4:$J$9999 and so on.

Is there any way of deleting a row without affecting the formulas that are looking at it?

View 9 Replies View Related

Deleting Lines - Keeping Formulas Fixed

Sep 6, 2007

With a macro i want to delete some lines in sheet1. In sheet2 however i have formulas that point on sheet1 .. like this

=sheet1!A1
=sheet1!A2
=sheet1!A3

Now when i delete line 2, the result would look like this
=sheet1!A1
#NV!
=sheet1!A2

Is there a way to make these formulas pointing at the same cells after line two is deleted? And i do not mean a work around, with different formulas. I just want the Formulas in sheet2 to remain unchanged, regardless of what happens in sheet1...

View 9 Replies View Related

Adding And Deleting Rows In Worksheet While Maintaining Formulas?

Mar 26, 2014

I have a Productivity Report that contains very basic formulas that provide totals for 4 columns (B6:E6) and an average for one column (F). I have included two command buttons, one to add a new row and the other to delete a row.

I need to be able to add or delete rows depending on how many employees' productivity I will be tracking on any given week; each row represents a separate employee. I need the following functionality out of my form:

1) formula in column F needs to copy and paste with each new line
2) when a new line is copied and pasted I need the contents to be cleared
3) I need the user to be blocked from deleting the first row (3 on this form) in the table

The code I'm using for my "Add" button is:

[Code].....

The code I'm using for my "Delete" button is:

[Code] .....
The buttons add and delete rows as I'd like them to but content is not clearing, with each row added the contents provide a sub total. I've tried various lines of code (some more complicated and some less) before I recorded my own macro (see above).

Attached File : Productivity Report (HH).xlsm‎

View 8 Replies View Related

Inserting / Deleting Rows And Cutting Cells Causing Corrupted Formulas

Dec 12, 2013

Whenever you insert / delete row or cut cells out in Mon/Tue sheets it's causing issues in the table in the Weekly view tab.

Is there any way to prevent it? I don't mind redoing whole spreadsheet, it was done ages ago in a very fast manner.

I gave you an idea by deleting a row range in Mon tab which causes #REF error.

View 9 Replies View Related

Userform Will Not Retain Changes

Sep 20, 2006

I am building a large Userform and I am going back to edit some of the controls (renaming, resizing, etc). The problem is, after editing, the changes don't stick. I can open another module and then open the form again and the changes will be gone. I can save Excel, close the file, and open it again, and the changes will be gone.

View 4 Replies View Related

Retain Formula In Cell

Feb 4, 2009

Is it possible to retain the formula in particular cells within an excel spreadsheet whilst clearing the rest of the sheet, and if so how?

View 3 Replies View Related

Retain Text Formate

Jun 11, 2009

I have a list that looks like this:

1. Here I have som formatted text.
2. Here too.
10. And here.
110. As well as here.

The content of each line is in a single cell.

How do I go about automatically chopping off the number, the dot and the space before the text, but retaining all formattings?

View 9 Replies View Related

Retain Formatting During Concatenation

Feb 4, 2009

I'm concatenating data in 5 cells (Author, Year, Title, City, Publisher), one of which is in italics (Title). When using concatenate (or &) the formatting is removed, and I need to be able to retain that formatting.

Example:
Col B
Aaron, M. (ed)
1999
The Body's Perilous Pleasures.
Endinburgh
Edinburgh University Press

View 4 Replies View Related

Retain Formatting In Textbox?

Mar 1, 2013

I have a textbox that displays text from another cell in the workbook. The other text has some sections in bold, but when it displays in the textbox it doesn't show the bold text - The code I'm using at the moment is below.

Private Sub UserForm_Initialize()
Dim R As Long
ComboBox2.List = Array("QuestionSet1", "QuestionSet2")

[Code].....

View 3 Replies View Related

Unmerge But Retain Value In All Cells

Aug 10, 2009

Seems like a dumb question but is it possible to unmerge say one "3 cell" merged cell with a value of "A" into 3 SINGLE CELLS with a value of "A"?

View 9 Replies View Related

Retain Data From A Formula

Oct 30, 2009

I need a solution so that each day I can get a value from a single cell but it appears in a new column each day.

eg, A1 contains a numerical value (based on a formula)
Each day there is a new column, say, Monday = B1, Tuesday = C1 etc.
On Monday B1 takes the value of A1 and 'freezes' the value in B1
On Tuesday C1 takes the value of A1 and 'freezes' the value in C1, but the value in B1 remains as it was when it was originally frozen.

View 9 Replies View Related

Set And Retain The Date That A Value Is Reached

Dec 10, 2009

I have a quantity column on an inventory sheet which automatically updates the available quantity based on sales from a sales sheet. But I need to know the date the quantity reached zero.

That date would always be "today," on the day the quantity = 0, but how do I make the date NOT update to "todays date" on the next day, and the next, etc. It needs to stay as the date that 0 qty was reached.

View 9 Replies View Related

Retain Data On Userform

Jun 30, 2006

i am using the following code to put data into a worksheet which it does perfectly. once the data is put into the sheet it is saved. what i want to do next is to retain the data in the userform and possibly change one or two entries and put data back into the sheet to save again

Option Explicit
Dim ans As Variant
Dim MyArray(100, 4)
Public MyData As Range, c, d As Range

Private Sub cmbAmend_Click()

Application. ScreenUpdating = False
Set c = Range("b4").End(xlUp).Offset(3, 0) ' c selected by Find
c.Value = Me.DTPicker1.Value ' write amendments to database
c.Offset(1, 0).Value = Me.TextBox1.Value
c.Offset(2, 0).Value = Me.TextBox2.Value
c.Offset(3, 0).Value = Me.TextBox3.Value
c.Offset(12, 0).Value = Me.ComboBox1.Value
Set d = Range("b16").End(xlUp).Offset(1, 0)

View 6 Replies View Related

Retain Leading Zeros

Dec 29, 2006

I can't seem to get the Concatenate function to work in my macro when there is a combination of numbers and text. It works fine is there are no alpha characters. I am using this macro to format all of the data in column "A" to have 5 characters and be text. These values will later be used in formulas and Pivot Tables.

Sub Macro2()

Dim sinlen As String
Dim sinformat As Variant
Dim lastcell As Variant

Range("b1").Select
Selection.EntireColumn.Select
Selection.Insert Shift:=xlLeft

Range("a1").Select

Do
ActiveCell.Value = "'" & ActiveCell.Value ......

View 9 Replies View Related

Retain Combobox Selection

May 30, 2007

I am programming some kind of database in excel and using comboboxes as drop down lists to enter some of the information in the DB. My problem is that when the file is saved, closed and then opened again, all of the comboboxes have lost their selection. I think that using the ControlSource might help but for some reason I can't find the proper syntaxe to make it works. Actually I am getting a Run time error 438: This object doesn't support this property or method.

I have included the relevant portion of my code below. Is the ControlSource property going to solve my problem? If so, what is the syntax I must use? If not, what can I do to make sure that my ComboBoxes are going to keep their selection?

ActiveSheet. OLEObjects.Add(ClassType:="Forms. ComboBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=hori_offset - 220, Top:=vert_offset + 78, _
Width:=180, Height:=24.75).Select
With ActiveSheet.OLEObjects("ComboBox1").Object
.Font.Size = 14
.Font.Bold = True
.Style = fmStyleDropDownList 'Use drop-down list
.BoundColumn = 0 'Combo box values are ListIndex values
End With
With ActiveSheet.Shapes("ComboBox1")
.OLEFormat.Object.ControlSource = "Q1"
.OLEFormat.Object.ListFillRange = "M1:M8"
End With

View 4 Replies View Related

Variables That Will Retain Value After Workbook Closes?

Aug 5, 2014

I need to create a variable that will be TRUE/FALSE based upon whether the user has made changes to a certain range without running a specific macro. Basically, if they change cells in a certain range, the 'Update' macro must be run. I want this variable to be False if the cells have changed without running 'Update' and then when 'Update' runs, it sets the variable back to True.

I've been able to make this work with a Public variable, but if the user closes the workbook, the variable resets to False. Is there a way to create a variable that will be remember even if the workbook closes?

View 2 Replies View Related

Compare Duplicate And Retain Only Latest One?

Feb 3, 2014

I have a list of values which also has duplicates. I want to remove the duplicates but after comparing it to the dates. Retain the latest date and remove the old dates Eg. there are two duplicates, one has a date of 31st Jan 2013 and the other one has a date of 25 jan 2013. I want to remove the duplicate which has the older date ( 25 Jan 2013) and keep the one which has the latest date.

View 2 Replies View Related

How Can I RETAIN Formatting In A Pivot Table

Mar 21, 2007

My data has various dates in column A, which I group into months using the formula "=DATE(YEAR(A2),MONTH(A2),1)" in column B. Then I format column B to show the results in the format mmm-yy. So far so good.

I then use a pivot table to count the number of entries for each month and I have formatted the date column the same way. But every time I refresh the data (which I need to do frequently as data floods in from external sources), the format of the pivot table reverts to dd/mm/yyyy and I have to go and manually reformat it again.

I've checked all the options I can think of, but cannot find any way to keep the format as I have set it. Does anybody know of a way?

I'm using Excel 2003 on Windows 2000 Professional.

View 9 Replies View Related

Concatenate And Retain Trailing Zeros

Dec 10, 2008

I cant seem to figure out how to concatenate data from two cells into one cell and retain trailing zeros. If Cell A1 has ".0000" and cell A2 has ".0005" then I want cell A3 to show:
".0000-.0005".

I get "0-.0005" on my attempts. Alos, how do I make the value an actual number and not a formula?

View 3 Replies View Related

Combining Two Numbers To Retain Integer Value

Oct 11, 2011

I have the two following columns

Report ID Facility ID 25 1 25 10 25 100 25 1000

And I need to "combine" the two numbers to create integer values so I can import the values into excel

The following is how I would like it formatted

250001
250010
250100
251000

so facility id has a numberformat of "0000" and then the report id is appended to that value.

View 4 Replies View Related

Retain Formatting When Inserting Rows Via VBA?

May 21, 2014

I'm using the following code to insert rows in a table of data:

Code:
For i = LR To 2 Step -1
If Range("D" & i).Value Range("D" & i - 1).Value Then Range("A" & i).EntireRow.Insert
Next i

It works as expected, but as my data table is formatted, the last row inserted does not contain the same formatting as the table.

View 1 Replies View Related

Retain Leading Zeros In Numbers

Aug 4, 2006

I have ID numbers that sometimes starts with one or more zeros and when i try to paste a string containing ID numbers that starts with a zero, excel converts it to a number thereby deleting the leading zero(s). Is there any way to force excel to keep the leading zero when i paste from the clipboard?

Clipboard.SetText strMyString, vbCFText
Set xlSheet = xlBook.Worksheets("Sheet1")
xlSheet.Activate
xlApp. ActiveWorkbook.ActiveSheet. Range("A2").Select
xlApp.ActiveWorkbook.ActiveSheet.Paste

I have tried setting the format for a column as text using xlSheet.Columns("D").NumberFormat = "text" before pasting to try to force excel to keep the leading zero but the ID# comes out unreadable as "############". I have also tried formatting as "General" and custom formatting the column before pasting but have been unsuccessful thus far. I've seen other programs accomplish pasting numbers with leading zeros but how do you do this?

View 3 Replies View Related

Retain Leading Zeros In VBA Array

Sep 29, 2006

I am just basically sorting through a huge dataset and grabbing unique codes and storing them in an array for later use. Some of the codes are numeric and some are alphanumeric therefore I am storing them as strings. However, when a code is for example 000578 - once a recall this from the array it has become 578. Is there anyway to preserve the entire code, i.e. make the array recall 000578.

View 6 Replies View Related

Unable To Retain Changes To Add-in Customised Toolbar

Oct 2, 2006

I have an add-in with an attached customised toolbar. If I add a new button to the toolbar, it will be available. However, if I unload the add-in and reload again, every changes to the toolbar buttons and menu items will be lost.

This is an example of what I have done:
1) I add a button to the add-in toolbar.
2) In VB editor, I change the IsAddin property to False so that the addin workbook is visible.
3) Under the Tools->Customized, I attached the toolbar to the add-in workbook.
4) In VB editor, I change the IsAddin property back to True.
5) After I unload and reload the add-in again, the new button is not available on the toolbar.

View 7 Replies View Related

Retain Control Focus After Update

Feb 4, 2008

I'm trying to set the focus back to the field that triggers an AfterUpdate event.

Private Sub myField_AfterUpdate()
myfield.SetFocus
End Sub

Code above sets the focus to the next field in the taborder instead of keeping the focus on the field (that didn't pass the validation) that triggered the AfterUpdate event.

View 3 Replies View Related







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