Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Select C6 down to last used cell, as determined in column B

Column B ALWAYS has entries in each cell.
The entries in B always go to bottom of used range on worksheet.
Once last cell is determined, need to select Column C6 down to last cell,
in order to process the following code.

' Select C6 down to last used row

Selection.FormatConditions.Add Type:=xlExpression,
Formula1:="=($B6=""*"")"
Selection.FormatConditions(1).Interior.ColorIndex = 4

any help would be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Select C6 down to last used cell, as determined in column B

Range(Range("C6"), Range("C6").End(xlDown)).Select

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Select C6 down to last used cell, as determined in column B

maybe something like this

Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
Dim lastrow As Long
lastrow = ws.Cells(Rows.Count, "B").End(xlUp).Row
ws.Range("C6:C" & lastrow).Select

--


Gary


"BEEJAY" wrote in message
...
Column B ALWAYS has entries in each cell.
The entries in B always go to bottom of used range on worksheet.
Once last cell is determined, need to select Column C6 down to last cell,
in order to process the following code.

' Select C6 down to last used row

Selection.FormatConditions.Add Type:=xlExpression,
Formula1:="=($B6=""*"")"
Selection.FormatConditions(1).Interior.ColorIndex = 4

any help would be appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Select C6 down to last used cell, as determined in column B

Try something like this.

Dim lLastRow As Long
lLastRow = Sheet1.Range("B:B").SpecialCells(xlCellTypeLastCel l).Row
With Sheet1.Range("C6:C" & lLastRow)
.Select
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=($B6=""*"")"
.FormatConditions(1).Interior.ColorIndex = 4
End With
Sheet1.Range("C6").Select



"BEEJAY" wrote:

Column B ALWAYS has entries in each cell.
The entries in B always go to bottom of used range on worksheet.
Once last cell is determined, need to select Column C6 down to last cell,
in order to process the following code.

' Select C6 down to last used row

Selection.FormatConditions.Add Type:=xlExpression,
Formula1:="=($B6=""*"")"
Selection.FormatConditions(1).Interior.ColorIndex = 4

any help would be appreciated.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Select C6 down to last used cell, as determined in column B

Thanks to all, for the prompt input.
With the following modification, I got exactly what was needed.

Dim ws As Worksheet
Set ws = Worksheets("Pricing")
Dim ILastRow As Long

ILastRow = ws.Range("B:B").SpecialCells(xlCellTypeLastCell).R ow
With ws.Range("C6:C" & ILastRow)
.Select
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=($B6=""*"")"
.FormatConditions(1).Interior.ColorIndex = 4
End With
ws.Range("C6").Select

Thanks Again.

"Vergel Adriano" wrote:

Try something like this.

Dim lLastRow As Long
lLastRow = Sheet1.Range("B:B").SpecialCells(xlCellTypeLastCel l).Row
With Sheet1.Range("C6:C" & lLastRow)
.Select
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=($B6=""*"")"
.FormatConditions(1).Interior.ColorIndex = 4
End With
Sheet1.Range("C6").Select



"BEEJAY" wrote:

Column B ALWAYS has entries in each cell.
The entries in B always go to bottom of used range on worksheet.
Once last cell is determined, need to select Column C6 down to last cell,
in order to process the following code.

' Select C6 down to last used row

Selection.FormatConditions.Add Type:=xlExpression,
Formula1:="=($B6=""*"")"
Selection.FormatConditions(1).Interior.ColorIndex = 4

any help would be appreciated.

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
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
Find DMIN in a column range determined by a number in another cell dlbeiler Excel Worksheet Functions 0 October 11th 07 07:09 PM
Column value for row = fiscal quarter (determined by date field) MJW[_2_] Excel Discussion (Misc queries) 4 August 3rd 07 10:31 PM
Look up sheet name determined in cell James Michael Excel Programming 4 August 16th 05 07:28 PM
Determined to eliminate .select Bruce Roberson Excel Programming 10 August 14th 03 12:34 PM


All times are GMT +1. The time now is 10:50 AM.

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"