i'm using the following code to make a selection bold or not (basically as a replacement for the bold button). It works fine unless you select a group of cells...some of which are already bold and some of which are not...in this case it doesn't work....here is the code
I am merging columns. Col B has all text in bold. Col C has all text in regular font. When I use ASAP to merge, the merged column comes out all bold. When I use a formula to merge the merged column comes out all regular. What I want is for the merged column to contain the bold text from Col B in bold, and the regular text from Col C in regular.
What I want is...
This is for service plan B: Take all data and transer to new server.
What I am getting is...
This is for service plan B:Take all data and transer to new server.
This is for service plan B:Take all data and transer to new server.
I'm new to VBA and needed help with: I need to 'bold' the row which contains sum, the problem is that the location of the row varies depending on how long/short the report is.... Here is the code I used to bold a particular row:
Range("A14").EntireRow.Font.Bold = True
But instead of A14, i need it to be a row of no more than 5 columns, one of which contains the word 'SUM'.
Is it possible to modify the attached code so that it will copy bold text and border as shown in attachment sample1 and paste in sheet Shop. Currently the code just copy's and pastes without bold text and borders.
I have a userform, on the user form I have a combo box. when i select an item from the combobox list. I want it to show only that item in the pivot table. here is my code.. Can anyone see where im going wrong? or what i need to ammend to achieve this?
Dim i As Integer With ActiveSheet.PivotTables("PivotTable2").PivotFields("Description") For i = 1 To .PivotItems.Count If i = ComboBox2 Then .PivotItems(i).Visible = True Else .PivotItems(i).Visible = False End If Next End With
I have a worksheet (with if statements) that I throw numbers from a report into and it uses those if statements to calculate the number of items and money earned. The problem is that sometimes employees use different key words for their items so the formulas dont pick them up and this skews their results for the month. Also it's hard to see where someone messed so I'm trying to write a code that reads each row for a given selection and calculates the sum and if that sum is 0 then we can look for where the employee made an error. This is what I have:
Dim RngToSum As Range Set RngToSum = Selection.Rows For Each Row In RngToSum If Application.WorksheetFunction.Sum(RngToSum) = "0" Then MsgBox "Lets play find the error" Selection.Rows.Interior.ColorIndex = 3 'red Else Application.WorksheetFunction.Sum(RngToSum) 0 Then MsgBox "Congrats there's no errors" End If End Sub
The problem with the code is that I want it to read every line and if there's no errors then have it say "congrats no errors" after ALL rows have been checked because right now it pulls a msgbox per row and I don't want to go through hundreds of no error msgboxes. However, if even just one line has an error then have a msgbox come up.
Also there's something weird where this code wont pick up an error for a row if i highlight two rows (one row without an error and one with) but if i highlight just rows of zeros then it'll pick it up.
This opens the first file and dRow="7/13/2006". The next file that it opens contains links to information from the previous days. Without VBA you just drag the previous day down, select the row of data and do a replace all, say from 0712 to 0713. As you can see I even tried to make it use the specific data I wanted versus the variables; still doesn't work. What really gets me is that if I go back to the sheet after this code runs, I go to EditReplace, replace all "0712" to "0713" and it does it. It has to be the code then right??
I have a workbook with various pages that are all hidden except the main page, on the main page it allows users to select items froms drop down boxes that returns a figure to cell B7 on the selection page.
What i would like to do is press a command button and the hidden worksheet that relates to that figure in cell B7 opens which allows the users to print it then after printing or closing the workbook is hidden again.
I have a list of 10 shops as a list box named lstitems i need the user to click one of the 10 shops and when they click the selected shop it tells the name they selected. then i require a Quit button that transfers the selected Shop to cell D3 & then closes the userform, but if they do not pick a shop it will ask them to pick one before it closes. so they must select or it will not close.
how I can disable an InputBox? I've got some code that whenever someone selects a cell in a specified range, an input box pops up (running a macro) - this can get annoying sometimes though if just browsing. Does anyone know a macro where I can "disable" this?
I have a userform, on the user form I have a combo box. when i select an item from the combobox list. I want it to show only that item in the pivot table.
Code: Dim i As Integer With ActiveSheet.PivotTables("PivotTable2").PivotFields("Description") For i = 1 To .PivotItems.Count If i = ComboBox2 Then .PivotItems(i).Visible = True Else .PivotItems(i).Visible = False End If Next End With
I've got a worksheet_selectionchange macro on a sheet, and another macro that you can run after it. The issue is that when the second macro runs, it also runs the selectionchange macro, and wipes some of the info that the second macro should be copying.
Is there a piece of code that I can use in the second macro to block the selectionchance code from running until it's compelte?
I'm making a macro that filters a data set and then inputs a value into all of the rows for a certain column. When no results show up for the filter I receive a runtime 1004 error because there are no cells to select.
If a user selects certain options from a drop down list created by cell verification (from list), is it possible to display an input box and have the resulting input populate on another worksheet in the workbook? I have an attendance template I'm working with and if a user selects OT (Over Time) then a input box is displayed prompting for how many hours. The overtime is then tracked on another worksheet.
I tried very hard to design a leave roster for user to mark their leave application. The criteria are as follows:
1. 4 applications per date 2. a region of worksheet (i.e. "A2 to H20) will be defined for users to "click" on the cells (within the defined region) to mark their application. 3. once a cell is clicked (i.e. marked), it cannot be altered. 4. each click will automatically increase the total by 1.
I got the following code to deal with the situation but user can still click on any cell outside the region (in fact I fail to define the region).
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim m ad = Mid(ActiveCell.Address, 2, 1) m = Range(ad & 24).Value 'here a formula "CountA(A2,A20)" will be place in the cell (24, c).......................
I have attached a portion of an excel file I am using at the moment. What I require is a piece of VBA code which will allow me to copy selected data based on a combo box selection. What needs to happen is this :-
If the selection in the "Index" worksheet combo box related to "Month" in cell G19 is for instance "December", I would like the macro to compare this cell value to the cell values in cells C96, C124, C152, C180, C209, C236, C263 and C290 in the "Tech Services" worksheet and where the values match.......copy the commentary (Range C126:Z147 in December's case) to the range C34:Z55.
I am working on a project where user has to select an item from a listbox, however there is a condition that if user select an item, other items of listbox should be disabled so that he/she can not select any other item.
I want to have a drop down list in a cell so that the value in the cell can be only selected from two columns of data. Additionally once the data from the first column has been selected I want to be able to limit the inputs the user can select from in the second column.
e.g. In cell C115 I want to have the value BDS05.
I want to be able to select the value BDS from a drop down list of values and once that value has been selected I want to be able select 05 from a list of values from 01 to 14 If I select BCS as the first value then I want the second set of values to be limited to 01 to 02 etc.
I have read about combo boxes and list boxes and I'm a bit confused about the best way to achieve this (or even if I can).
I am trying to use VBA code to set the last row to bold. I have been able to set the entire row to bold using:
Code: EntireRow.Font.Bold = True
but I would like for the code to be more dynamic. I.E. Only making cells on the last row Bold If they contain values. I have been able to do something similar in the past with interior color on the header row but, am looking for the same type of thing for the last row in this instance. The code I was able to use to turn the interior color of cells Green looked like this: