Format Help needed

JohnJay

New Member
Joined
Mar 7, 2002
Messages
37
Does anyone know if there is a way to spit out all the formatting and formula info for a row? What I would like to do is be able format an entire row on the fly if a user clicks on a row that is not formated.

thanks John
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Ok. AddIn's are just "hidden" workbooks. So, you can have a preformatted row in the AddIn. Test with something like:

If ActiveSheet.UsedRange.Count = 1 then
'It's an empty sheet
else
'Not an empty sheet
End If

How about that ?

That condition could also be:

Cells.SpecialCells(xlCellTypeLastCell).Address = "$A$1"

or

Application.Counta(ActiveSheet.UsedRange) = 0

I like the best this last one.
 
Upvote 0
Hi John

This may not be exactly what you are looking for but it may give you some ideas.

Say your rows all have the same format and formulas (ie they can be scrolled down) and they start at row #, then try this:

Insert a row at the top of your worksheet. Copy row # and paste it to row 1. Hide row 1.
Paste this code to a macro that runs from a button on your worksheet:
Set x = ActiveCell.EntireRow
On Error Resume Next
Application.ScreenUpdating = False
Rows("1:1").Copy
x.Select
Selection.Insert Shift:=xlDown
ActiveCell.EntireRow.Hidden = False
End Sub
Title the button "Insert New Row" Provide some instruction..."to insert new row: First select row then click this button (new row will insert above row selected)".
You could force use of this by protecting your sheet and having the macro remove protection, run, then reprotect.

Hope this is of some help
regards
Derek
 
Upvote 0
I think that will do for the blank worksheet. now is there a way to tell if a whole row is empty?
 
Upvote 0
Juan,

I tried that last one and that works for blank sheets. What I was looking for is that if a user clicks on a row, and it is not already formated like I mentioned before, then format it, else do nothing. I thought about checking at least 3 cells in the row for a match of what is suppose to me there, but I thought there might be a simpler way to check the format againts the one in the addin and then proceed on that finding.
 
Upvote 0
Again, sorry. There's not. You'll have to loop, and you can use the SelectionChange() to trigger that event. If you think you can check only three cells then this would not take long.

This stuff may be needed:

.Font.Bold
.Font.Italic
.Font.Color
.Interior.Color
 
Upvote 0
Actuall I do have 3 cells that are colored, and I can always add in a font color to check....Thats great..
Thanks juan
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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