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

I seem to be having brain lock and cannot figure out how to add additional
formatting to my code.
Code below.
I'm looking for cells that contain markers and copying that range to a new
worksheet. I'm retaining the value of the cells and also would like to format
the cells with the "" marker as bold and LeftJustified.
Your suggestions would be greatly appreciated.

Dave

Sheets("Items").Activate
ktr = 8
Set percrange = Range(Cells(1, 1), Cells(150, 1))
For Each thing In percrange
If IsNumeric(thing) And (thing 0) Or (thing = "") Or (thing =
"") Then
ktr = ktr + 1
currrow = thing.Row
Range(Cells(currrow, 1), Cells(currrow, 9)).Select
Range(Cells(currrow, 1), Cells(currrow, 9)).Copy
Sheets("Sheet").Activate
Range(Cells(ktr, 1), Cells(ktr, 9)).PasteSpecial (xlPasteValues)
Sheets("Items").Activate
End If
Next

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Adding Formatting to Code

Sub OrderSheetSAS()
Dim lr, br, dlr As Long
Dim c, firstaddress, i
Sheets("Order Sheet").Rows("7:100").Delete
With Worksheets("Fortis Items")
lr = .Cells(Rows.Count, "a").End(xlUp).Row
On Error Resume Next
For Each c In .Range("a2:a" & lr)
If InStr(c, "") Or c 0 Then
dlr = Sheets("Order Sheet").Cells(Rows.Count, 1).End(xlUp).Row + 1
Sheets("Order Sheet").Range("c1:c4").Value = _
Sheets("System Configurator").Range("c3:e6").Value
Sheets("Order Sheet").Rows(dlr).Value = .Rows(c.Row).Value
End If
Next c
End With
CleanUpSAS
End Sub

Sub CleanUpSAS()
Dim lr As Long
Dim c
With Sheets("Order Sheet")
lr = .Cells(Rows.Count, 1).End(xlUp).Row
For Each c In .Range("a7:a" & lr)
If InStr(c, "") Then
..Rows(c.Row).Font.Bold = True
c.ClearContents
End If
Next c
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DaveH" wrote in message
...
I'll send you my wb.

"Don Guillett" wrote:

This could be a lot more efficient. Show us your layout or send your wb
to
my address below with before/after examples.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DaveH" wrote in message
...
I seem to be having brain lock and cannot figure out how to add
additional
formatting to my code.
Code below.
I'm looking for cells that contain markers and copying that range to a
new
worksheet. I'm retaining the value of the cells and also would like to
format
the cells with the "" marker as bold and LeftJustified.
Your suggestions would be greatly appreciated.

Dave

Sheets("Items").Activate
ktr = 8
Set percrange = Range(Cells(1, 1), Cells(150, 1))
For Each thing In percrange
If IsNumeric(thing) And (thing 0) Or (thing = "") Or (thing =
"") Then
ktr = ktr + 1
currrow = thing.Row
Range(Cells(currrow, 1), Cells(currrow, 9)).Select
Range(Cells(currrow, 1), Cells(currrow, 9)).Copy
Sheets("Sheet").Activate
Range(Cells(ktr, 1), Cells(ktr, 9)).PasteSpecial
(xlPasteValues)
Sheets("Items").Activate
End If
Next




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Adding Formatting to Code

Don,
Works like a charm!
Many many thanks!

"Don Guillett" wrote:

Sub OrderSheetSAS()
Dim lr, br, dlr As Long
Dim c, firstaddress, i
Sheets("Order Sheet").Rows("7:100").Delete
With Worksheets("Fortis Items")
lr = .Cells(Rows.Count, "a").End(xlUp).Row
On Error Resume Next
For Each c In .Range("a2:a" & lr)
If InStr(c, "") Or c 0 Then
dlr = Sheets("Order Sheet").Cells(Rows.Count, 1).End(xlUp).Row + 1
Sheets("Order Sheet").Range("c1:c4").Value = _
Sheets("System Configurator").Range("c3:e6").Value
Sheets("Order Sheet").Rows(dlr).Value = .Rows(c.Row).Value
End If
Next c
End With
CleanUpSAS
End Sub

Sub CleanUpSAS()
Dim lr As Long
Dim c
With Sheets("Order Sheet")
lr = .Cells(Rows.Count, 1).End(xlUp).Row
For Each c In .Range("a7:a" & lr)
If InStr(c, "") Then
..Rows(c.Row).Font.Bold = True
c.ClearContents
End If
Next c
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DaveH" wrote in message
...
I'll send you my wb.

"Don Guillett" wrote:

This could be a lot more efficient. Show us your layout or send your wb
to
my address below with before/after examples.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DaveH" wrote in message
...
I seem to be having brain lock and cannot figure out how to add
additional
formatting to my code.
Code below.
I'm looking for cells that contain markers and copying that range to a
new
worksheet. I'm retaining the value of the cells and also would like to
format
the cells with the "" marker as bold and LeftJustified.
Your suggestions would be greatly appreciated.

Dave

Sheets("Items").Activate
ktr = 8
Set percrange = Range(Cells(1, 1), Cells(150, 1))
For Each thing In percrange
If IsNumeric(thing) And (thing 0) Or (thing = "") Or (thing =
"") Then
ktr = ktr + 1
currrow = thing.Row
Range(Cells(currrow, 1), Cells(currrow, 9)).Select
Range(Cells(currrow, 1), Cells(currrow, 9)).Copy
Sheets("Sheet").Activate
Range(Cells(ktr, 1), Cells(ktr, 9)).PasteSpecial
(xlPasteValues)
Sheets("Items").Activate
End If
Next





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
Conditional Formatting: Adding more then 3 davednconfused Excel Worksheet Functions 3 July 17th 08 12:36 AM
adding code lines with vba code thread Excel Programming 4 February 6th 08 01:31 PM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
adding to a VBA COde diacci1st Excel Programming 0 November 23rd 06 11:21 AM
Formatting for and adding thousandths of a second John Kaurloto Excel Worksheet Functions 5 September 14th 06 08:12 PM


All times are GMT +1. The time now is 03:18 PM.

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

About Us

"It's about Microsoft Excel"