here's a macro, needs a few adjustments...

Big Tom

New Member
Joined
Apr 11, 2002
Messages
5
Following is a very simple macro. All i need to know is how to re-write that so that when it has run, i can then apply it to the line that has been moved to (i.e. 417), or whatever line i want (not just 416).

Range("B416:J416").Select
Selection.Font.bold = True
Range("B417").Select

It has been suggested that a for loop would work, but i have no way of finding out how to do that.

Thanks for your help if you can do it. If not, don't worry - i'm sure someone can...
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Here's a few ideas that should get you started...

'To do the current row
Range("B" & ActiveCell.Row & ":J" & ActiveCell.Row).Font.Bold = True

'To do a specified row, i.e. Row 417
Dim MyRow As Integer
MyRow = 417
Range("B" & MyRow & ":J" & MyRow).Font.Bold = True

'To do all rows in the sheet in a loop where
'the value in column B is greater than zero
Dim LastRow As Integer
LastRow = Range("B65536").End(xlUp).Row
For x = 1 To LastRow
If Range("B" & x).Value > 0 Then
Range("B" & x & ":J" & x).Font.Bold = True
End If
Next x


Hope this helps
AJ
 
Upvote 0
Hello,
Try sth different, it will put in Bold a selection you manually and will then select the next row on the same first column.

Selection.Font.Bold = True
Cells(Selection.Rows(Selection.Rows.Count).Row + 1, Selection.Columns(1).Column).Select

I hope it was what you wanted.
Pierre
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,414
Members
448,895
Latest member
omarahmed1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top