Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Formatting issue....

Do you realize that using If...ElseIf means that the code will sto
after the first time that condition evaluates to true? You could d
something like this:

For x = 17 To 20
If Worksheets("April").Cells(x, 15).Value = "BOLD" Then
Worksheets("April").Cells(x, 3).Font.Bold = True
End If
Next x

- Piku

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Formatting issue....

this works, but I need to go all the way to row 174

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Formatting issue....

For x = 17 To 174
If Worksheets("April").Cells(x, 15).Value = "BOLD" Then
Worksheets("April").Cells(x, 3).Font.Bold = True
End If
Next

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Formatting issue....

I also need to use this for May through March (the 11 other worksheets)
How would I go about implementing this change

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default VBA - Formatting issue....

Hi
missd that part :-) Though you could also use then:
sub foo()
dim row_index as long
Application.Run "'Part D-1 Regular.xls'!Unprotect_Sheet_Password"
for row_index = 17 to 200
with activesheet.cells(row_index,"O")
if .value = "Bold" then
.offset(0,-12).font.bold=true
exit for
end if
end with
next
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany


Do you realize that using If...ElseIf means that the code will stop
after the first time that condition evaluates to true? You could do
something like this:

For x = 17 To 20
If Worksheets("April").Cells(x, 15).Value = "BOLD" Then
Worksheets("April").Cells(x, 3).Font.Bold = True
End If
Next x

- Pikus


---
Message posted from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Formatting issue....

For z = 1 To 12
For x = 17 To 174
If Worksheets(MonthName(z)).Cells(x, 15).Value = "BOLD" Then
Worksheets(MonthName(z)).Cells(x, 3).Font.Bold = True
End If
Next x
Next

--
Message posted from http://www.ExcelForum.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Formatting issue....

This is better...

Application.ScreenUpdating = False
For z = 1 To 12
With Worksheets(MonthName(z))
For x = 17 To 174
If .Cells(x, 15).Value = "BOLD" Then
.Cells(x, 3).Font.Bold = True
End If
Next x
End With
Next z
Application.ScreenUpdating = True

That should be a bit faster. - Piku

--
Message posted from http://www.ExcelForum.com

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Formatting issue....

Great! This works, no problem. Thanks guys

--
Message posted from http://www.ExcelForum.com

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Formatting issue....

:-

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting issue Juboe Excel Discussion (Misc queries) 3 September 14th 09 04:30 PM
Formatting Issue Mike Excel Discussion (Misc queries) 3 June 18th 09 12:38 AM
CSV formatting issue sueasmith31 Excel Discussion (Misc queries) 1 May 19th 09 08:00 PM
formatting issue? chip_pyp Excel Discussion (Misc queries) 4 January 31st 06 09:22 PM
Formatting issue adin Excel Worksheet Functions 10 April 22nd 05 06:21 PM


All times are GMT +1. The time now is 04:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"