VBA Bold Selection Code

Oct 9, 2008

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

View 2 Replies


ADVERTISEMENT

How To Run Macro If Selection Is Not Bold And If Bold Then Do Nothing

Aug 5, 2012

How do we run a macro if the selection is not bold and If bold then do nothing.

View 3 Replies View Related

Merging Cols Changes Bold To Non-bold Or Non-bold To Bold

Jun 8, 2008

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.

OR

This is for service plan B:Take all data and transer to new server.

View 9 Replies View Related

VBA Code To Bold Row Which Contains SUM

Jul 27, 2009

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'.

View 9 Replies View Related

Formula Or Code To Only Copy Text In Bold From Sheet1 To Sheet2

Jun 8, 2014

I want text that's in bold in column B in sheet 1 of my spreadsheet to copy over into column A in sheet 2 of my spreadsheet - is there a quick way of doing this using code or a formula?

View 3 Replies View Related

Code Adjustment To Copy And Paste Bold Text And Border?

Aug 13, 2014

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.

Sample1.PNG

View 4 Replies View Related

Make 1 Cell Bold If Another 1 Is Bold

Oct 2, 2007

I am trying to create a macro that if a value in a cell in column A is bold, then the value in the same row in column H is bold, then loop it to run on the rest of the worksheet.

View 9 Replies View Related

Delete All Text Which Is Not 'bold' In Cells With 'mingled Bold' Text

Jan 23, 2010

I want to have a function or macro that if cells have mingled bold text, that only the bold text shall remain in the cells, and all the rest of the text must be deleted.

View 4 Replies View Related

VBA Code On Filling A Selection With Series

Dec 20, 2011

whats the vba code in filling a selection with a series 1 ,2 ,3, 4, 5, and so on?

cant seem to find it in google and cant make it out on macro recorder

View 3 Replies View Related

Pivot Items Selection Code

Nov 23, 2006

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

View 9 Replies View Related

Writing VBA Code To Add Borders To Selection

Mar 4, 2008

I got some code from an old discussion thread


Sheets("Reference").Select
Range("d9").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select

Dim myBorders() As Variant, item As Variant
myBorders = Array(xlEdgeLeft, _
xlEdgeTop, _
xlEdgeBottom, _
xlEdgeRight, _
xlInsideVertical)

View 9 Replies View Related

Trying To Use Vba Code To Evaluate Each Row In A Highlighted Selection

Jul 22, 2009

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.

View 9 Replies View Related

Code Not Working If No Selection In Listbox

Jun 16, 2006

Why this code doesn´t enter in the if condition when i don't select any item from the listbox

semana = ListBox1.Value
If semana = Null Then
MsgBox ("Need to choose one item!!!")
Else
emd = Range("A48").Value
End If

View 3 Replies View Related

Selection.Replace Code Not Working

Jul 14, 2006

This one has really got me stumped:

Sub NCR()
Application.DisplayAlerts = False
Workbooks.Open ("J:AcctMgt3NWFMScriptingScriptsDailyReportsNCRNCRvdn.xls")
Sheets("NCRvdn").Columns("B:B").EntireColumn.AutoFit
dRow = Sheets("NCRvdn"). Range("B1").Text
dMonthDay = Format(dRow, "mmdd")
dDay = Format(dRow, "dd")
dPrevDay = dDay - 1
dMonthName = Format(dRow, "mmmm")
dMonthNum = Format(dRow, "mm")
dYear = Format(dRow, "yy")
dPrevDay2 = dMonthNum & dPrevDay.............

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??

View 3 Replies View Related

VBA Code For Printing Worksheets That Are Hidden From A Selection

Jan 19, 2013

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.

View 4 Replies View Related

VBA Code To Close Userform After Data Selection Only?

Sep 11, 2013

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.

View 9 Replies View Related

Stop Code Firing On Selection Change

Nov 22, 2006

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?

View 4 Replies View Related

Combobox List - Pivot Items Selection Code

Nov 23, 2006

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

View 9 Replies View Related

Code To Stop A Worksheet Selection Change Macro Running

Aug 17, 2009

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?

View 6 Replies View Related

Create Surface Chart Via Macro Code Based On Selection

May 28, 2008

I want to write a macro to add a surface chart for a Data Range which includes 6000 data points. But the series selected for the chart don't cover all Data Ranges, only part of them.

Public Sub AddChart2(LastRow As Integer, LastCol As Integer)

Dim cht As ChartObject, currentSheet As Worksheet
Dim rng As Range, newRow As Range, srcRange As Range
Dim colIdx As Integer

colIdx = 5

View 7 Replies View Related

How To Skip To Next Section Of Code When Filtered Table Returns No Values For Selection

May 1, 2014

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.

Here is my code:

Sheets("External Buys").Select
Range("G5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Raw Data").Select
ActiveSheet.Range("$A$1:$AU$10432").AutoFilter Field:=39, Criteria1:= _

[Code] ......

View 1 Replies View Related

Displaying Input Box Based On User Selection Of Dropdown Selection?

Jun 3, 2013

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.

View 1 Replies View Related

Increment Cell On Selection And Lock/Protect From Re-Selection

Oct 3, 2006

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).......................

View 2 Replies View Related

Copy & Paste Selection Based On Combo Box Selection

Jan 30, 2007

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.

View 9 Replies View Related

Disable Selection In Listbox On Selection Of Item

Apr 4, 2013

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.

Is there any way to do that as I tried

VB : Listbox.enabled = False
and
VB : Listbox.locket = True

in Listbox - Click/Change but no desirable results got.

View 1 Replies View Related

Restrict Drop-Down Selection Based On Selection From Another

Jul 20, 2007

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).

View 6 Replies View Related

Set Last Row To Bold?

Sep 1, 2013

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:

Code:
Range("A1", Cells(1, Columns.Count).End(xlToRight)).SpecialCells(xlCellTypeConstants).Interior.ColorIndex = 3

View 3 Replies View Related

Sort By Bold

May 21, 2007

I need to sort by cells that are bold. Does anybody know a way I can do this?

View 10 Replies View Related

Last Day Of Month Bold

Sep 6, 2007

Col. A are dates,I would like to format Cells so the last day of the month is bold useing conditional fomating

View 9 Replies View Related

Concatenate And Bold

Nov 10, 2008

I have a simple concatenate in Excel...

=CONCATENATE(A1, ", ", A2)

Which produces:

This is, my text

Now, I want 'my text' i.e. the contents of A2 to be in bold.

I've played with the TEXT() function before, as per this page:
[url]

To get Excel to play nicely with date formats and stuff, however, my research has come to a dead end with Bold/Italic - with everyone suggesting that VBA is the only solution.

As I don't feel overly comfortable using VBA is there any other solution? (If not, is this a VBA 101 task or an advanced task?)

View 9 Replies View Related







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