Have a column containing data which may have 1-3 dashes locates within each cell value. Such as: 125-457A 158-857-1116 124184A-1 125-8745-22D9 458-2145-002-7
Would like to remove all the dashes "unless" the last dash to the right is followed by a just a single digit. The results would be as follows:
I have a column of city names, some are one word and others are two or more. I am trying to take the city name and add it to another word, add dashes in between them and make everything lower case. For example:
Column 1, Cell 1 is: San Diego
I'd like it to look like: books-san-diego (books being the keyword I'd like to insert before the city.)
I have a column of data (column A) with cells that have IDs (alpha-numeric) that contain anywhere between 0 to 5 dashes. Since this column will change weekly, I want to dynamically pull only those cells that contain 3 dashes.
I would only want to have returned 10648145-3026718-t526363536m since it contains 3 dashes. Do you know of a nifty formula for doing this? I think an array would get me the dynamic piece (so they are not spaced out).
I'm trying to find a way to have excel 2003 format the data I put in a cell to auto insert dashes every five characters. I'm entering product keys for the software we have on hand, and it would be a little quicker if I could simply have excel auto format the data entered in to include dashes every five characters.
Example: - I would enter: D5ATT3D28F6F44536489413E2 (This is a fake, non-working product key, I just typed in random numbers a letters.)
-Excel would format it like: D5ATT-3D28F-6F445-36489-413E2
I have this script that does what i need it to do but one thing, I need the script to count the numbers as digits only and not the dashes in the format.
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Intersect(Target, Range("I21:I24")) Is Nothing Then Exit Sub Application.ScreenUpdating = False Application.EnableEvents = False If (Len(Target) > 11) Or (Len(Target) < 10) Then MsgBox "Not a valid number of characters, please try again" Target.Value = vbNullString...................
I believe I have 99% of what I need. The code below has one bug. (See just the underlined text for a very quick overview. The rest is detail.)
My goal is to generate a TOC that: 1) has the VBA run from my Personal Workbook. 2) can be run in any worksheet of any open workbook. 3) can be run in a worksheet of any name. 4) will insert itself at the currently active cell. 5) has entries hyperlinking to the referenced worksheets - of any name.
Right now, I'm stuck with the last point. The macro below will generate the TOC at the currently active cell. The TOC will be hyperlinks to the referenced worksheets.
However, if the referenced worksheet contains a space, dash, or other special character then the generated hyperlink is broken. For example, if the referenced worksheet is "sheet1" then the hyperlink generated works just fine. However, if the referenced worksheet is "sheet-1" then the generated hyperlink doesn't work.
Sub IndexList() Dim objSheet As Object Dim intRow As Integer Dim strCol As Integer
Set objSheet = Excel.Sheets intRow = ActiveCell.Row 'Start writing in active row strCol = ActiveCell.Column 'Start writing in active column
For Each objSheet In ActiveWorkbook.Sheets Cells(intRow, strCol).Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _ objSheet.Name & "!A1", TextToDisplay:=objSheet.Name intRow = intRow + 1 Next End Sub
I am needing a custom format for the following. I need a cell entry to be 1 letter, three numbers, a dash, 5 numbers, a dash, two numbers, a dash, and then two number. Example: A109-54785-13-00. The first letter will almost always be an "A."
To further complicate the matter, the entry is copied from an email and pasted without the dashes. In the above example, the number in the email would read, "A109547851300." I copy it from the email and paste it in the proper cell in the worksheet. I would like the custom format to automatically enter the dashes at the appropriate spot.
If it was all numbers, this would be easy. I created a custom format for the numbers, but when the A is included, Excel no longer treats it as a number and the custom format did not work.
Is this possible in Excel (without VBA).
I could use the custom number format I created and then later go back and add the "A" at the beginning, but that is as much work as manually adding the dashes.
I need a macro that searches my spreadsheet for a keyword in Column B. If it finds the keywords (or an array of keywords would be even better), it then deletes the entire row above the keyword, the row with the keyword, and the row below the keyword.
If the macro finds the text in column 2, it would delete 1, 2 and 3.
I need to have a second macro that performs a very similar function. it copies the 3 rows (similar to the example below) to a different sheet based on the keyword.
deletes a row if it finds a specified value in a specified column (in this instance, "NB" in column E). However, it is very slow and some end users are complaining about the amount of time it takes to run. Here's what I'm using at the moment:
I’ve got a macro that automatically starts when the workbook is open. The macro finishes with
Application.Dialogs(xlDialogSaveAs).Show
The document will be always saved with a new name. As I just need the macro once when the workbook is created I’m looking for a code that deletes the macro before the workbook is saved. I tried to record a macro while I was deleting another macro, but apparently it is not working (the recorded macro is empty). Does anyone know if there exists a code to delete a macro?
i have this macro made by another member here that looks for "T" in column 10 and deletes entire row if in that row has a "T". I need it modified to also delete if it contains "FT" and also erase if cells is blank.
Sub Macro8() Sheets("FORMERS").Select 'deletes entire rows based on a text on one row (this case errases all that have a "T" in column 10 (column J)
Dim DeleteValue1 As String Dim rng1 As Range Dim calcmode1 As Long With Application calcmode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With...........................................
The file that I am currently working on is getting really big. It is currently 101MB and we aren't done yet. In contains a lot of Macros and also a lot of ordinary excel formulas. I have recently noticed that excel sort of gets unstable with this file. For instance if I select a very large area eg A200:IK19000 and delete it, it only deletes the first entry (A200). What is going on? Is this a typical excel thing? What can I do to fix it or avoid it in the future?
It takes all numbers in column 4 starting with Row 15 and deletes all duplicates. It then shows the number of times the number was duplicated and puts this number in column 3. MY PROBLEM: The macro searches each line and takes FOREVER! I have data with thousands of lines. I already tried the screenupdating method which really doesn't help that much. Is there possibly a better code for doing this?
Sub Factor() Dim sID As String Dim sOldID As String Dim lLastRow As Long Dim lrow As Long Dim lcount As Long Dim lLoop As Long lLastRow = ActiveSheet. Cells(Rows.Count, 1).End(xlUp).Row lrow = 15 sID = ActiveSheet.Cells(lrow, 4).Value sOldID = "ActiveSheet.Cells(4, 15).Value" lcount = 1 lLoop = 1 Do While Len(sID) <> 0 If sID <> sOldID Then If lLoop = 1 Then.................................
I work in the Oil and Gas industry and deal with large data tables that have "Location Codes" for lack of a better term.
The problem is that not all Databases use exactly the same format of code, they will however always have the following:
xx-xx-xx-xx ---> ie. a string of four numbers each seperated by a Dash.
This string sometimes will appear after a text name of varying length. With this in mind I would like to parse the four numbers into four different columns.
Things I've tried with some success:
Using the "Right" function to break off the location code off the end of the entire name, and then using the ".parse" command in VB to seperate the numbers at given intervals.
This is great for certain purposes however because the four numbers are not always 2 digits, and the ".parse" command cuts at given intervals it is hard to accurately parse an entire set of data.
I have a macro that that stops every time I’m trying to delete the sheet. I get this message. “Data may exist in the sheet(s) selected for deletion. To permanently delete the data, prese Delete.” and I have to manually click “delete” to continue running the macro. How can I avoid this stop so that macro runs thru it without stops?
I need help writing a macro. I only have experience recording them, not writing them in VBA.
I need to check columns A and B for blanks. If A and B are both blank, I want the macro to delete the row and move on to check the next row. I need to perform this macro for the entire worksheet.
I need a Macro that deletes all cells in column D of all worksheets in a book that are equal to the word "Timeout" and to shift the cells to the right of the "Timeout" cells into the deleted cells but leaving all other rows where the word "Timeout" is not present.
So in the case of Rows 2, 4, 6 and 8 containg the word "Timeout" in column D, I would like cells D2, D4, D6 and D8 deleted and the remaining cells shifted to the left but cells D1, D3, D5 and D7 left as they are.
Dim rng As Range Dim i As Integer, counter As Integer
Set rng = Range("1:1")
i = 1
For counter = 1 To rng.Columns.Count
'If cell i in the range contains an "x", 'delete the column If rng.Cells(i) = "x" Then rng.Cells(i).EntireColumn.Delete Else i = i + 1 End If
Next
My problem is that I have cells in other worksheets linked to the worksheet that is running this macro and everytime I run it, I get a handful of "#REF" errors. I think this problem might be solved if I could simply delete the contents of the column rather than deleting the entire column. How can I modify my code to do this?
I am trying to parse and remove unwanted rows from a very large text file using At the moment, the application runs rather slow and was wondering if the experts could give some pointers on how to make the code more efficient while still keeping it simple so others may be able to modify later. I am keeping the ScreenUpdating True as the alternative false will just show Excel as Not Responding to the user until the VB is finished.
Sub deleteReplaceRows() Application.ScreenUpdating = True Dim DeletedRows As Integer Dim lastRow As Long Dim Arr(7) Arr(1) = "<PUZZLE>" Arr(2) = "<%" Arr(3) = "%>" Arr(4) = "Response." Arr(5) = "</PUZZLE>" Arr(6) = "<HINT>" Arr(7) = "<MESSAGE>"
For i = 1 To 7 Do Set rng = Columns(1).Find(Arr(i)) If rng Is Nothing Then Exit Do rng.EntireRow.Delete DeletedRows = DeletedRows + 1...................
I have a spreadsheet that shows a dash in some blank cells and I can't get rid of it. Cells are formatted as general, there's no event code, no conditional formatting, no data validation, no auto-formatting, no nothing. I can copy a cell from outside the range with no dash in it and paste it into one of the cells with the dash and the dash remains. I can't figure it out.