Code Change Didn't Keep Formatting Of Extra Column
Jun 1, 2014
I changed the code below to add an extra column(E) this worked. However it does not keep the formatting from the top row in column E, How can i change the code to column E to keep the top row formatting ??
Also i added a list to cell A2, but this moves down, I would like to have the selected data move down but the list stays in cell A2, Was this possible ?
the code i have got is attached below but the problem i am having is when i enter the letter "H" which is calculated in AJ and i enter it fast it comes up with the error "Out Of Stack Space error 28". AJ in the code below is where the cumlative value is stored, and AI is the value that it is measured against it AJ is greater than AI the message is displayed.
Private Sub Worksheet_Change(ByVal Target As Range) Dim rRow As Range Dim icolor As Integer Dim ifont As Integer With Application .CellDragAndDrop = False .CutCopyMode = False End With If Intersect(Target, Me.Range("TABLE1")) Is Nothing Then Exit Sub Me.Calculate For Each rRow In Target.Rows If Me.Cells(rRow.Row, "AJ") > Me.Cells(rRow.Row, "AI") Then rRow.ClearContents MsgBox "No Holidays Left or No Holidays setup Against Them " & Me.Cells(rRow.Row, "AI") & " days."............................
I have an excel sheet which contains the data in blue. In another sheet I have the same data but with an extra code (red). For my question I have put both in one sheet. My problem is that I need to combine the extra code info in the sheet with the blue data. Both the blue column and first red column are identical.
Below code isnt working for "5 Metre", columns dont hide from row 24 down.
My A10 is a drop down where i select 5 or 6 or 7 metre. If i select 5 it only hides rows 22 and 23.
I think the 2nd and 3rd lines marked red are stopping the rows from hiding!
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$10" Then Rows("22:40").Hidden = (Target.Value = "5 Metre") Rows("24:40").Hidden = (Target.Value = "6 Metre") Rows("26:40").Hidden = (Target.Value = "7 Metre") End If End Sub
I have a spreadsheet where one column will determine the color of the entire row....if the sales persons name in column B = "Dew", the entire row should be shaded light blue. if the name is "Swiger" they should be white, when its Webb, it should be light blue again- alternatively, at every change in value in that column, alternate the entire rows shade - when the sales person name changes from Dew to Swiger, change the shading of Swigers Rows to white, when it changes from Swiger to Webb, make Webb's rows shaded the same blue as Dew's row's were....there are multiple rows for each sales person.
I have this macro below and would like the code changed to find the "Customer Number" column by name rather than by column B. Note that the "Customer Number" column will always be somewhere in row 1.
I have a macro which opens one excel file, then copies the data into another, dead easy. However the first file is 'downloaded' from a bespoke package, where (for whatever reason) the package appends a number of spaces (" ") after data in one of the columns,
So sometimes the data will contain one, ten or more extra spaces (no telling how many) ie, it could look like "AB ", "AB ", or "AB " etc
Ideally What i need is a small bit of code that once the data has been imported to my sheet it can run and 'strip' extra spaces from the column, lets say column f, to leave all the data in this column to look like:
I have a spreadsheet where column H can be either yes or no. When column H changes to Yes I want the background of the whole row to change to Red.
e.g. Cell H4 contains the word no. I then change this so that it says "yes". I want the background of row 4 to go red. so A4, b4, c4, d4, e4, h4 all go red.
With the type of conditional formatting i normally do i can only get cell H4 to go Red by putting cell value = yes as the condition. I cant for the life of me think of a formula or way round of doing this.
I have this code below that deletes any single occurrence of a customer number but the "Customer Numbers" must be in column A.
I would like to change the code below to instead look for the "Customer Number" column by name, rather than by column A. My "Customer Number" column will always be in row 1, but yet, it will be in a different column letter every time I run the report.
I have this code, which is primarily built by the record macro utility. I know that record macro does some unnecessary steps such as selecting while inserting columns etc which is generally never done in vba.
I have a macro that runs through a list and stores elements to an array. If the element is not found in my list, it adds to the next available row and adds the value from the array to that cell. Right now, I am searching in column d but am storing the value of column a at that location. When I switch the reference to column D, the value is not inserted into my new list.
Here is my current code:
Code: Sub Arraytest() Dim arr As Variant, lastrow As Long, i As Long, f As Long, l As Long, lastrow2 As Long, insertrow As Long
[Code].....
Why does the code not work properly when I switch to D? The value is storing correctly in the array. I test this by the last line of the code and it executes properly.
the Ruler across the top that allows you to adjust the column widths (A B C D etc). Is it possible to insert another Ruler, further down the same page, to allow you to adjust the column width differently. if so how. On Excel 2007
I'm in need of some VBA code (to be included in a Macro) that will automatically use the TRIM function for all cells in a whole column and that will then replace the values in that column with the resulting TRIM values. I have a LOT of individual files with varying #'s of records in them, so a way that will address all of them (all the cells in the specified column due to varying #'s of records) would be best.
I think the title pretty much says it all... Now I have a file I can't send to anyone to do anything with... I've googled a few things but I've found nothing to work with... It was only a few hours worth of work but this seems ridiculous...
In the attached file, the "importer.xls" is the file that has the ADO code and range of area for the data to be pasted, while the "Data to be imported.xls" is the source data that i want to copy which is in range "B1:D5" from each sheet "nightshift" & "dayshift". If you run the code, if would only copy partial of the data, could anyone plz fix the problem for me
I'm trying to analyse all of my bank statenments to see where all my money went!! I've got online banking so I thought it would be a relatively easy process of copying and pasting each month into excel.
Well, that in itself was easy, the problem is with the formatting of the financial numbers. Excel doesn't seem to recognise them as numbers, so at the moment I can't do any manipulation with the numbers. I have tried everything such as:
Format Cells > Number > Number and Currency Copy and Paste Special > Values only Copying into Notepad and back into Excel
Even if it appears to have changed the numbers to 'number' or 'currency' formatting by right justifying the numbers, if I try to add up the numbers using the SUM function, it doesn't want to know.
For some reason nothing seems to work - what am I missing?
For an example, I have attached a snippet of the spreadsheet with my starbucks transactions.
I started playing around with the macros feature, and hit "record" but didn't save anything. Now, whenever I try to close my sheet, it gives the "save changes" prompt, even when nothing's changed. There are no saved macros to delete...no idea what I did or how to get rid of it. I tried copying the cells to a new worksheet, and the new one gives the save prompt as well.
I have problem to change text code into numerical code using macro. i have data contain text code and i would like to convert it into numeric . each text code has dedicated numerical code for example I have 4 fluids with text code text code:
FW = Fresh water SW = Saline eater CW = connate water MW = Meteoric water
numeric code as follow
FW=1 SW=2 CW=3 MW=4
I would like to convert the text code into numeric code, it is easy if using excell , but it is routine job for me , i need to create macro to be more simple .
I have recorded the code below that does what I need, problem is I will use the code on files with various amounts of rows. What can I change in it so it will work on all different size files.
I have used the below code to insert a new row when the value in coulmn A change. I now need to evolve it so that the new row will contain a specific value depending on the changing value:
Before: Column A Column B one test one test two test two test three test three test
After:
Column A Column B one test one test Coz two............................
How would I add this formula as a worksheet function with VBA. I can't see INT, MOD or Year in VBA. Also want to change C2 to change to activecell column + row 2.