Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default if column I is blank, then puts an "a" in column A.

I need code that if column I ,starting with row 2 (with unknown number of
rows) is blank, then puts an a in column A.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default if column I is blank, then puts an "a" in column A.

Sub PutA()
Dim rng As Range, cell As Range
Set rng = Application.Intersect( _
Range("I2:I65536"), ActiveSheet.UsedRange)
If Not rng Is Nothing Then
For Each cell In rng.Cells
If Len(cell.Value) = 0 Then
Cells(cell.Row, "A").Value = "a"
End If
Next cell
End If
End Sub


"Randy Reese" wrote in message
link.net...
I need code that if column I ,starting with row 2 (with unknown number of
rows) is blank, then puts an a in column A.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default if column I is blank, then puts an "a" in column A.

This puts a's all the way to row 500. My test data goes to row 171.

"Tim Zych" wrote in message
...
Sub PutA()
Dim rng As Range, cell As Range
Set rng = Application.Intersect( _
Range("I2:I65536"), ActiveSheet.UsedRange)
If Not rng Is Nothing Then
For Each cell In rng.Cells
If Len(cell.Value) = 0 Then
Cells(cell.Row, "A").Value = "a"
End If
Next cell
End If
End Sub


"Randy Reese" wrote in message
link.net...
I need code that if column I ,starting with row 2 (with unknown number

of
rows) is blank, then puts an a in column A.






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default if column I is blank, then puts an "a" in column A.

Hi

Try
Sub aaa()
Range("i65536").End(xlUp).Select
While ActiveCell.Row 1
If IsEmpty(ActiveCell) Then Cells(ActiveCell.Row, 1) = "a"
ActiveCell.Offset(-1, 0).Select
Wend



End Sub


This will find the last entry in column I and work up from
there.

Tony
-----Original Message-----
This puts a's all the way to row 500. My test data goes

to row 171.

"Tim Zych" wrote in message
...
Sub PutA()
Dim rng As Range, cell As Range
Set rng = Application.Intersect( _
Range("I2:I65536"), ActiveSheet.UsedRange)
If Not rng Is Nothing Then
For Each cell In rng.Cells
If Len(cell.Value) = 0 Then
Cells(cell.Row, "A").Value = "a"
End If
Next cell
End If
End Sub


"Randy Reese" wrote in message
news:1uw1c.28856

...
I need code that if column I ,starting with row 2

(with unknown number
of
rows) is blank, then puts an a in column A.






.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default if column I is blank, then puts an "a" in column A.

This doesn't work if last rows are blank. Column B always has something in
it if this helps. Perhaps code to find used range can look at B, but look
for Blanks in I???

"acw" wrote in message
...
Hi

Try
Sub aaa()
Range("i65536").End(xlUp).Select
While ActiveCell.Row 1
If IsEmpty(ActiveCell) Then Cells(ActiveCell.Row, 1) = "a"
ActiveCell.Offset(-1, 0).Select
Wend



End Sub


This will find the last entry in column I and work up from
there.

Tony
-----Original Message-----
This puts a's all the way to row 500. My test data goes

to row 171.

"Tim Zych" wrote in message
...
Sub PutA()
Dim rng As Range, cell As Range
Set rng = Application.Intersect( _
Range("I2:I65536"), ActiveSheet.UsedRange)
If Not rng Is Nothing Then
For Each cell In rng.Cells
If Len(cell.Value) = 0 Then
Cells(cell.Row, "A").Value = "a"
End If
Next cell
End If
End Sub


"Randy Reese" wrote in message
news:1uw1c.28856

...
I need code that if column I ,starting with row 2

(with unknown number
of
rows) is blank, then puts an a in column A.






.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default if column I is blank, then puts an "a" in column A.

Hi

Ok revised using column B

Sub aaa()
Range("B65536").End(xlUp).Select
While ActiveCell.Row 1
If IsEmpty(ActiveCell.offset(0,7)) Then Cells
(ActiveCell.Row, 1) = "a"
ActiveCell.Offset(-1, 0).Select
Wend
End Sub

Tony
-----Original Message-----
This doesn't work if last rows are blank. Column B always

has something in
it if this helps. Perhaps code to find used range can

look at B, but look
for Blanks in I???

"acw" wrote in

message
...
Hi

Try
Sub aaa()
Range("i65536").End(xlUp).Select
While ActiveCell.Row 1
If IsEmpty(ActiveCell) Then Cells(ActiveCell.Row, 1)

= "a"
ActiveCell.Offset(-1, 0).Select
Wend



End Sub


This will find the last entry in column I and work up

from
there.

Tony
-----Original Message-----
This puts a's all the way to row 500. My test data goes

to row 171.

"Tim Zych" wrote in message
...
Sub PutA()
Dim rng As Range, cell As Range
Set rng = Application.Intersect( _
Range("I2:I65536"), ActiveSheet.UsedRange)
If Not rng Is Nothing Then
For Each cell In rng.Cells
If Len(cell.Value) = 0 Then
Cells(cell.Row, "A").Value = "a"
End If
Next cell
End If
End Sub


"Randy Reese" wrote in

message
news:1uw1c.28856

...
I need code that if column I ,starting with row 2

(with unknown number
of
rows) is blank, then puts an a in column A.






.



.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default if column I is blank, then puts an "a" in column A.

Thanks Tony, works great.
"acw" wrote in message
...
Hi

Ok revised using column B

Sub aaa()
Range("B65536").End(xlUp).Select
While ActiveCell.Row 1
If IsEmpty(ActiveCell.offset(0,7)) Then Cells
(ActiveCell.Row, 1) = "a"
ActiveCell.Offset(-1, 0).Select
Wend
End Sub

Tony
-----Original Message-----
This doesn't work if last rows are blank. Column B always

has something in
it if this helps. Perhaps code to find used range can

look at B, but look
for Blanks in I???

"acw" wrote in

message
...
Hi

Try
Sub aaa()
Range("i65536").End(xlUp).Select
While ActiveCell.Row 1
If IsEmpty(ActiveCell) Then Cells(ActiveCell.Row, 1)

= "a"
ActiveCell.Offset(-1, 0).Select
Wend



End Sub


This will find the last entry in column I and work up

from
there.

Tony
-----Original Message-----
This puts a's all the way to row 500. My test data goes
to row 171.

"Tim Zych" wrote in message
...
Sub PutA()
Dim rng As Range, cell As Range
Set rng = Application.Intersect( _
Range("I2:I65536"), ActiveSheet.UsedRange)
If Not rng Is Nothing Then
For Each cell In rng.Cells
If Len(cell.Value) = 0 Then
Cells(cell.Row, "A").Value = "a"
End If
Next cell
End If
End Sub


"Randy Reese" wrote in

message
news:1uw1c.28856
...
I need code that if column I ,starting with row 2
(with unknown number
of
rows) is blank, then puts an a in column A.






.



.



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
Create Pivot Table Data with Column "Sum" rather than "count" defa Johnny_99[_2_] Excel Discussion (Misc queries) 2 January 2nd 10 03:25 PM
Auto Filter - how to collapse "non-blank" cells in a column? marla Excel Discussion (Misc queries) 2 August 24th 08 10:03 PM
How do I change the column heading in Excel to display "A" "B" "C Thai New Users to Excel 1 November 30th 07 08:06 PM
how can I count if column A="active" and column E="Job" in a list? Brandoni Excel Worksheet Functions 1 October 14th 06 09:09 AM
Removing "Blank Cells" from a column PaulQuincy Excel Worksheet Functions 4 February 13th 06 07:49 AM


All times are GMT +1. The time now is 05:24 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"