Hi,
I need to test a value in column B, and if it is less than 30, offset (0,2) and apply a number format to the value in column d. Then test the next B, and so on. I'm using Excel 2013. Thanks.
Hi,
I need to test a value in column B, and if it is less than 30, offset (0,2) and apply a number format to the value in column d. Then test the next B, and so on. I'm using Excel 2013. Thanks.
Hi, welcome to the forum
Have you looked at using Conditional Formatting for this?
1. highlight the range you want to apply the conditional formatting to (the range in column D)
2. on the home tab, styles, select CF
3. select new rule, select use formula
4. enter =A2<30 format as required
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Hi SGW, maybe this?
![]()
Please Login or Register to view this content.
Please help by:
Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know
There are 10 kinds of people in this world... those who understand binary, and those who don't.
No, because I need to automate this for many worksheets on a regular basis. I'm thinking along these lines, but I'm not defining something correctly:
#Dim b As Range
For Each b In ActiveSheet.UsedRange
If b < 30 Then Offset(0, 2).NumberFormat = "?0.0""%*"""
Next b
#
sgw your code would check every used cell on the active sheet, did you look at the code I posted?
This looks good, but it has to work across sheets, so I have to set active sheet..I'll fool with this and see, thanks
SGW across ALL sheets?
You can replace the "set ws = " line with set ws = activesheet, so you can activate the sheet you want, call macro, and activate next sheet, etc
Yes, Arkadi, across all worksheets in the workbook. I haven't had a chance to try your code yet, it looks promising.
![]()
Please Login or Register to view this content.
Hi Arkadi,
Something's not working through correctly, does not step through each row on the active sheet. Thanks--I'll spend some more time with this.
Works on my end, but it only works through rows where b is not blank.
Let me know if and when I can help more![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks