Preserve Function When Inserting Cells
Apr 21, 2009I'm using IF functions to get the difference of two cells. An example:
View 5 RepliesI'm using IF functions to get the difference of two cells. An example:
View 5 RepliesI have 2 columns which contain numbers that have laeding zeros. example:
Column H has 002345 and Column I has 0678. I have tried H1&I1 but the leading zeros are stripped off. Is there a way to combine 2 cells AND preserve the leading zeros in both cells ?
I have a cell with some text in it that has formatting applied (bold in this case). I want to append some text on the end using VBA, but preserve the existing font formatting information. So say I have "one bold one" in my cell, I'm executing the following: ActiveCell.Value = ActiveCell.Value & "two"
But this wipes out the bold information. Is there any way of preserving the bold that's already in the cell. Either perhaps by copying the Characters object and reapplying it, or by some other method?
Another interesting dilemma to solve. Using this formula:
View 2 Replies View RelatedI'm inserting a function in a cell via code:
[Code] ........
The problem is that I want the second cell of the NETWORKDAYS function (in this case: R2C11) to be a variable cell. I want it to be cells(2, c - 3).
The code below pulls information based on what i specify in a userform from another sheet.
I am trying to total the last 3 columns but for some reason the code sticks the sum formula right in middle of all my information. However, when i run the code (the exact same way) again then the code puts the sum underneath the last row as indicated in the code. How can i get the code to run right the first time around?
I have around 700 workbooks in a folder on my PC.
My master file(master database.xlsx) is kept open from which i have to Vlookup the values into these 700 workbooks.
The "agent Id" column is common in both the master database.xlsx as well as those other workbooks also.
The thing i want to do is i need the data from the "reporting supervisor" which is in the master database.xlsx file to be available in the G column of the other 700 books ( i have attached only 4 sample books). The G column can be then named as "Reporting Supervisor". Since "Agent ID" is available in both files we can vlookup taking this as a base. I have attached the 4 sample files out of 700 as well as the master database file in a zip file.
I have a piece of code that hides unneeded rows, it does work but it is very slow.
This is in the worksheet part of the project. My problem is as it runs it "jumps" in to a function I have in a module that counts continuous rows. I would like to know why it is doing this and what I need to do to stop it? I have another piece of code that is structered exactly the same that hides unneeded columns and I do not have any problems with that. I know both pieces of code are dealing with rows and I think this is part of the problem but I can not see any reason why the first bit would call the second bit?
Dim C
With Worksheets("CEN OAS"). Range("D5:D378")
.EntireRow.Hidden = False
End With
For Each C In Worksheets("CEN OAS").Range("D5:D378")
If C.Value = "" Then
C.EntireRow.Hidden = True
End If
Next C
Function to count used rows....................
The delete function has disappeared from my EDIT menu in excel. Delete and Insert has also disappeared when I right Click on the spreadsheet.
I have recently purchased a new GPS for my fishing boat. I am trying to transfer my old coordinates from one unit to the other. I am using a .csv file to achieve this. Can some kind please let me know (and possibly tell me) if there is way to insert characters and spaces in to multiple cells. I have over 800 individual coordinates to modify to the new gps and this would take a long time to achieve individually.
I need to replace this: 12.34.567 to this: 12 34.567 N
and this: -1.23456 to this: 001 23.456 W
I have a spreadsheet that has formulas in cells C3 to C10 (cells C3 to C10 have =(sheetc), (cells C3 to C10) formulas. I want to be able to add a row somewhere in between those cells and have the that new row take on the same cell formula as the others...resulting in cells C3 to C11 now having formulas..
View 1 Replies View RelatedI am trying to store values into a dynamic array. The size of the array will vary each time, so I need the range to be dynamic. Most importantly, I need all values to be retained in the array. Currently, a value will be stored, but once the next round of the for loop is initiated, the array changes to "<subscript out of range>" and stays that way until the it is replaced by the next value. So, there isn't an accumualtion in the array--it goes one value, to out of range, to one value, etc.
View 8 Replies View RelatedI am having when trying to preserve a hyperlink when using VLOOKUP. I have two worksheets within the same workbook. Worksheet 1 contains a lot of information for internal use(many of the cells in all of the columns contain hyperlinks to web addresses), and Worksheet 2 should be a version identical to this, showing only the selected columns suitable for external use. This is to avoid using two different 'work trackers'; so, when info in Worksheet 1 is updated, Worksheet 2 should automatically be updated and reflect this.
I am currently using the following code:
Function GetHyperLink(r As Range) As String
If r.Hyperlinks.Count Then
GetHyperLink = r.Hyperlinks(1).Address
End If
[Code].....
I m trying to save my excel file as a pdf. all is working great except the fact that i have a few cells that contain hyperlinks (via HYPERLINK formula). when exported, they are being converted to a simple text, loosing the link.
thus my question is this, would anyone know of a proper way to export an excel file so that ALL hyperlinks are preserved? be it with excel or any other program/converter.
I have made a pivot table and in Pivot table option Merge labels for colum b. I the problem i am facing is once i give this the next colum text filed is automatically arranged in center. I want the next colum as left alignment. Once i delete some rows in the data then if i refresh it automatically align the next colum to center. I have given the preserve formatting as well as i have un selected the autoformat colum.
View 2 Replies View RelatedI have programmed a button that allows the user to import XML data into my workbook via the following
Sub Button5_Click()
FileToOpen = Application. GetOpenFilename("XML files (*.xml), *.xml")
If FileToOpen <> False Then
ActiveWorkbook.XmlMaps("RouteDoc_Map").Import (FileToOpen)
End If
End Sub
All my XML data comes in great to the associated mapped cells (on several worksheets) but the data that is coming in as a list erases the alternating white/gray conditional formating that I've applied via FORMULA IS =MOD(ROW(),2). How would I be able to preserve the alternating white/gray conditional formating, no matter how many rows are being imported via my button ?
task of inserting a block of cells into a worksheet.
I have saved 4 different blocks of cells and depending on an option chosen from a drop down menu i want to select one of more of these sets of data and paste them into a worksheet.
This problem just appeared recently, as if out of the blue, and it seems to affect all of my old work sheets as well as new ones. I am using 2002 version. When I input any number in any cell the program automatically inserts a decimal point. Thus 1 becomes .1, 12 becomes 1.2, 123 becomes 12.3 etc. I have tried formatting the cells to "general" and to to "number" with no change. The thing that really gets me is that old saved worksheets exhibit this behavior as well. I can work around the problem by inputting 1. or 12. which then gives me the entry I am after but I've never needed to do this before.
View 2 Replies View RelatedI have a spreadsheet that has 5 columns, with the headers:
Code
Description
Colour
Size
Price
There are over 500 lines on this spreadsheet.
The Blue headers have all the information filled in, whereas the Red headers do not.
I have a second tab on that spreadsheet with the below information filled in.
Code
Description
Colour
Size
Price
Now my problem is that I need to merge the 2 tabs into 1...however....
The codes on tabs are not in the same order, and on the first tab, they are interspersed with merged rows with the category name, whereas the second tab they are just a full list.
My current issue is that I need to enter a $ into multiple formulas before cell numbers without having to do it manually, is there a way to do this? I cannot drag the cell across with the $ already entered as this will change the cell reference in an adjacent cell.
If this is not clear, what my scenario is that I have a 250 x 2500 cell table. Going across the x axis the formula is: J2-AVERAGE(J$2:J$11) then the next cell K2-AVERAGE(K$2:K$11) and so on. I now want a $ to appear before J and K without having to manually insert $ into every formula, so that I can drag the columns down varying the column number.
Suppose I have done a spreadsheet of,say 100 entries in alphabetical order in a column and I discover that I have missed 6. Is it possible to move the existing part from where I missed below this to make room for more entries without losing any of the entries?
View 3 Replies View RelatedI have a long row of text cells in a range. Starting with the 1st cell I want to insert 3 empty to the right, then repeat for the next cell that had originally butted up against the first cell until 3 cells have been inserted for each cell in the range.
View 2 Replies View RelatedI have two sections to this spreadsheet: 1) the entity section; 2) the order section.
I have created a macro to insert rows in both these sections. The macro appears to work fine for the first section but not for the second section. The problem I cannot solve is in respect of cells D9:D10. The macro is as follows:
I want to add (same) text to the end of a whole bunch of cells. What would be the formula or function in Excel 2007 for this? I want to add ":59" to the end of each of these:
manages
blankdisk
dentist4u
desktopsupportservices
oznc
5st
divinehope
kcdm
pokeroyunlari
hdgallery
This may sound trivial, but how do you insert a column to the right of the current selection?
If I do Selection.EntireColumn.Insert that inserts a column to the left. Anyone know how to do this?
I have a workfile, containing dates in column C and values in column G.
The data is imported. In most instances there are no dates in line with the second value. I need VBA code that will insert a the same date in line with the first value below the cell where there is a date....
I have an inventory sheet with rows containing a formula. I've placed the same formula in all 65536 rows that Excel 2003 has.
I have a macro to delete unused items. It searches for an item number then deletes that row. (Actually it deletes the item number and a partial row based on an offset, but that was for an earlier version and an entire row would be okay) When a row is deleted, all the other rows move up and Excel creates a new last row (65536) The problem is that this new row has no formulas. While it's probably unlikely that I'll ever blow through 65536 rows, it seems sloppy to leave this unaccounted for.
Is there a way to either add the existing formula(s) to the last row...or insert a new row *somewhere* that is empty except for the formula of the other rows in the sheet? Here's what I have for the existing code.
Code:
'Search for item to delete based on entry to InputBox
Sub Delete_Item()
Dim FindString As String
Dim Rng As Range
Dim YesOrNoAnswerToMessageBox As String
Dim QuestionToMessageBox As String
[code].....
Within Worksheet_BeforeDoubleClick, I have the following simple code extract that sets the appropriate autofilter to the correct value (and highlights a couple of cells for clarity) when a particular cell is double-clicked...
If Not Intersect(Target, Range("C10:AQ11")) Is Nothing Then
If Not Intersect(Target, Range("C10:D11")) Is Nothing Then
Selection.AutoFilter Field:=10, Criteria1:="C"
Range("C10:D11").Interior.ColorIndex = 36
End If
You'll be happy to hear that the event works as expected.
However I would like to add the following enhancement: after Worksheet_BeforeDoubleClick completes the "double-clicked cell" is selected, is it possible for the "original" cell to be re-selected once the event completes?
My current headache is that I want to be able to reinstate excel formula when the delete key is hit. However there this is a slight catch. I don't just want to be able to do this for one cell but reinstate the same excel forumla in an entire cloumn (ie for multiple rows). On top of this I also need to find a way of being able to do this for multiple columns (ie column 1 has formula 1, column 2 has formula 2 etc.....)
I have found this but I am having trouble adapting it to suit my purpose. This code just reinstates the formula for 1 cell.
Worksheet module:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address "$A$1" Then
Application.OnKey "{del}"
Else
Application.OnKey "{del}", "myFormula"
End If
End Sub
Sub myFormula()
Worksheets("Sheet1").Range("A1").Formula = "=RC[1]+RC[2]"
End Sub
I am making template and trying to preserve formatting when users paste into a cell. From my research, I have found that this is impossible with simple format protection, it works to prevent changing formating, but if something is pasted (with normal paste), the format will change.
I have found a few solutions, but can't get them to work correctly
Solution A: Disable normal paste and substitute Paste Special - Values
How will this work with pasting via CTRL + V and the right click menu? I need both to function.
Solution B: Allow users to paste normally, but use a macro to copy formatting from a hidden sheet
I actually found code for this, but I couldn't figure out exactly how to impliment it. The sheet that users will be pasting into is called "Batch Summary" and I was trying to pull formatting from a sheet names "Batch Summary Format", but was getting an error.