Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Enter "Empty" if cell is blank within a variable range

As simple as this sounds, I can't seem to make this work. I am looking for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is blank. The
range can be variable. The only columns that contain an empty cell are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Enter "Empty" if cell is blank within a variable range

Hi Alatl,

Try somethimg like:

'================
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Const sStr As String = "Empty"

Set WB = Workbooks("MyBook.xls") '<<===== CHANGE
Set SH = WB.Sheets("Sheet1") '<<===== CHANGE

With SH
On Error Resume Next
Set Rng = Intersect(.UsedRange, .Columns("A:B")). _
SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
End With

If Not Rng Is Nothing Then
Rng.Value = sStr
End If
End Sub
'<<================

---
Regards,
Norman


"ALATL" wrote in message
...
As simple as this sounds, I can't seem to make this work. I am looking for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is blank.
The
range can be variable. The only columns that contain an empty cell are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Enter "Empty" if cell is blank within a variable range

Norman,

This part of the code never executes and the cell does not get populated
with the empty value.

Rng.Value = sStr

Best,
ALATL

"Norman Jones" wrote:

Hi Alatl,

Try somethimg like:

'================
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Const sStr As String = "Empty"

Set WB = Workbooks("MyBook.xls") '<<===== CHANGE
Set SH = WB.Sheets("Sheet1") '<<===== CHANGE

With SH
On Error Resume Next
Set Rng = Intersect(.UsedRange, .Columns("A:B")). _
SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
End With

If Not Rng Is Nothing Then
Rng.Value = sStr
End If
End Sub
'<<================

---
Regards,
Norman


"ALATL" wrote in message
...
As simple as this sounds, I can't seem to make this work. I am looking for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is blank.
The
range can be variable. The only columns that contain an empty cell are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Enter "Empty" if cell is blank within a variable range

If you select the range to fix and
Edit|replace
what: (leave blank)
with: Empty
replace all

does it work?

If it does, then you could just hit Edit|Undo and record a macro when you do it
manually (one more time).



ALATL wrote:

As simple as this sounds, I can't seem to make this work. I am looking for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is blank. The
range can be variable. The only columns that contain an empty cell are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Enter "Empty" if cell is blank within a variable range

If that statement isn't executed, then you don't have empty cells in that range.

Maybe you converted formulas that evaluated to "" to values?

Or maybe you used the spacebar to make the cell look empty?

ALATL wrote:

Norman,

This part of the code never executes and the cell does not get populated
with the empty value.

Rng.Value = sStr

Best,
ALATL

"Norman Jones" wrote:

Hi Alatl,

Try somethimg like:

'================
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Const sStr As String = "Empty"

Set WB = Workbooks("MyBook.xls") '<<===== CHANGE
Set SH = WB.Sheets("Sheet1") '<<===== CHANGE

With SH
On Error Resume Next
Set Rng = Intersect(.UsedRange, .Columns("A:B")). _
SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
End With

If Not Rng Is Nothing Then
Rng.Value = sStr
End If
End Sub
'<<================

---
Regards,
Norman


"ALATL" wrote in message
...
As simple as this sounds, I can't seem to make this work. I am looking for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is blank.
The
range can be variable. The only columns that contain an empty cell are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.





--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Enter "Empty" if cell is blank within a variable range

Dave,

I have checked the value of the cell with the following.

Dim Test As String
Test = Range("B2").Value

The debugger displays an empty string value.

I have tried to use the Edit Replace functionality in Excel, but this does
not work and it says "Cannot find a match".

Also, the total number of rows is variable dependent on the data when the
application is run. It would not be a good things to do a "select all" and
have additional rows accidentally introduced into my data.

I've seen something like this used to look at the last row of data to begin
looking for a range.


'Set WS = Worksheets("Sheet2")
'BottomRowPos = WS.Range("B65536").End(xlUp).Row

Thanks for your help.


"Dave Peterson" wrote:

If you select the range to fix and
Edit|replace
what: (leave blank)
with: Empty
replace all

does it work?

If it does, then you could just hit Edit|Undo and record a macro when you do it
manually (one more time).



ALATL wrote:

As simple as this sounds, I can't seem to make this work. I am looking for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is blank. The
range can be variable. The only columns that contain an empty cell are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Enter "Empty" if cell is blank within a variable range

Hi ATATL,

My suggeste code will populate all empty cells columns A:B,
up to the last used row in the sheet


What response do you get to:

MsgBox IsEmpty(Range("B2")

?


---
Regards,
Norman

"ALATL" wrote in message
...
Dave,

I have checked the value of the cell with the following.

Dim Test As String
Test = Range("B2").Value

The debugger displays an empty string value.

I have tried to use the Edit Replace functionality in Excel, but this
does
not work and it says "Cannot find a match".

Also, the total number of rows is variable dependent on the data when the
application is run. It would not be a good things to do a "select all" and
have additional rows accidentally introduced into my data.

I've seen something like this used to look at the last row of data to
begin
looking for a range.


'Set WS = Worksheets("Sheet2")
'BottomRowPos = WS.Range("B65536").End(xlUp).Row

Thanks for your help.


"Dave Peterson" wrote:

If you select the range to fix and
Edit|replace
what: (leave blank)
with: Empty
replace all

does it work?

If it does, then you could just hit Edit|Undo and record a macro when you
do it
manually (one more time).



ALATL wrote:

As simple as this sounds, I can't seem to make this work. I am looking
for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is
blank. The
range can be variable. The only columns that contain an empty cell are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.


--

Dave Peterson



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Enter "Empty" if cell is blank within a variable range

Norman,

The MsgBox returns a "False". When I look at the result of the Test variable
in the debugger, it shows an empty string: " ".

Dim Test As String
Test = Range("B2").Value

I appreciate your feedback!
ALATL



"Norman Jones" wrote:

Hi ATATL,

My suggeste code will populate all empty cells columns A:B,
up to the last used row in the sheet


What response do you get to:

MsgBox IsEmpty(Range("B2")

?


---
Regards,
Norman

"ALATL" wrote in message
...
Dave,

I have checked the value of the cell with the following.

Dim Test As String
Test = Range("B2").Value

The debugger displays an empty string value.

I have tried to use the Edit Replace functionality in Excel, but this
does
not work and it says "Cannot find a match".

Also, the total number of rows is variable dependent on the data when the
application is run. It would not be a good things to do a "select all" and
have additional rows accidentally introduced into my data.

I've seen something like this used to look at the last row of data to
begin
looking for a range.


'Set WS = Worksheets("Sheet2")
'BottomRowPos = WS.Range("B65536").End(xlUp).Row

Thanks for your help.


"Dave Peterson" wrote:

If you select the range to fix and
Edit|replace
what: (leave blank)
with: Empty
replace all

does it work?

If it does, then you could just hit Edit|Undo and record a macro when you
do it
manually (one more time).



ALATL wrote:

As simple as this sounds, I can't seem to make this work. I am looking
for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is
blank. The
range can be variable. The only columns that contain an empty cell are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.

--

Dave Peterson




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Enter "Empty" if cell is blank within a variable range

Hi Alatl,

Try the following version:


'================
Public Sub Tester2()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Const sStr As String = "Empty"

Set WB = Workbooks("MyBook.xls") '<<===== CHANGE
Set SH = WB.Sheets("Sheet1") '<<===== CHANGE

With SH
Set Rng = Intersect(.UsedRange, .Columns("A:B"))
With Rng
.Replace Space(1), vbNullString
.Replace Chr(160), vbNullString
On Error Resume Next
Set Rng = .SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
End With
End With

If Not Rng Is Nothing Then
Rng.Value = sStr
End If
End Sub
'<<================


---
Regards,
Norman



"ALATL" wrote in message
...
Norman,

The MsgBox returns a "False". When I look at the result of the Test
variable
in the debugger, it shows an empty string: " ".

Dim Test As String
Test = Range("B2").Value

I appreciate your feedback!
ALATL



"Norman Jones" wrote:

Hi ATATL,

My suggeste code will populate all empty cells columns A:B,
up to the last used row in the sheet


What response do you get to:

MsgBox IsEmpty(Range("B2")

?


---
Regards,
Norman

"ALATL" wrote in message
...
Dave,

I have checked the value of the cell with the following.

Dim Test As String
Test = Range("B2").Value

The debugger displays an empty string value.

I have tried to use the Edit Replace functionality in Excel, but this
does
not work and it says "Cannot find a match".

Also, the total number of rows is variable dependent on the data when
the
application is run. It would not be a good things to do a "select all"
and
have additional rows accidentally introduced into my data.

I've seen something like this used to look at the last row of data to
begin
looking for a range.


'Set WS = Worksheets("Sheet2")
'BottomRowPos = WS.Range("B65536").End(xlUp).Row

Thanks for your help.


"Dave Peterson" wrote:

If you select the range to fix and
Edit|replace
what: (leave blank)
with: Empty
replace all

does it work?

If it does, then you could just hit Edit|Undo and record a macro when
you
do it
manually (one more time).



ALATL wrote:

As simple as this sounds, I can't seem to make this work. I am
looking
for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is
blank. The
range can be variable. The only columns that contain an empty cell
are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.

--

Dave Peterson






  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Enter "Empty" if cell is blank within a variable range

Norman,

This code handled my issue. Thanks for your input.

Sub Empty_()

Dim LastRow As Long

Sheets("Sheet2").Select
LastRow = ActiveSheet.Range("A65536").End(xlUp).Row

'Process Column B
Range("B2").Select

Do
If Trim(ActiveCell.Text) = "" Then
ActiveCell.Value = "Empty"
End If

ActiveCell.Offset(1, 0).Select

Loop Until ActiveCell.Row = LastRow

'Process Column C
Range("C2").Select

Do
If Trim(ActiveCell.Text) = "" Then
ActiveCell.Value = "Empty"
End If

ActiveCell.Offset(1, 0).Select

Loop Until ActiveCell.Row = LastRow

End Sub


"Norman Jones" wrote:

Hi Alatl,

Try the following version:


'================
Public Sub Tester2()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Const sStr As String = "Empty"

Set WB = Workbooks("MyBook.xls") '<<===== CHANGE
Set SH = WB.Sheets("Sheet1") '<<===== CHANGE

With SH
Set Rng = Intersect(.UsedRange, .Columns("A:B"))
With Rng
.Replace Space(1), vbNullString
.Replace Chr(160), vbNullString
On Error Resume Next
Set Rng = .SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
End With
End With

If Not Rng Is Nothing Then
Rng.Value = sStr
End If
End Sub
'<<================


---
Regards,
Norman



"ALATL" wrote in message
...
Norman,

The MsgBox returns a "False". When I look at the result of the Test
variable
in the debugger, it shows an empty string: " ".

Dim Test As String
Test = Range("B2").Value

I appreciate your feedback!
ALATL



"Norman Jones" wrote:

Hi ATATL,

My suggeste code will populate all empty cells columns A:B,
up to the last used row in the sheet


What response do you get to:

MsgBox IsEmpty(Range("B2")

?


---
Regards,
Norman

"ALATL" wrote in message
...
Dave,

I have checked the value of the cell with the following.

Dim Test As String
Test = Range("B2").Value

The debugger displays an empty string value.

I have tried to use the Edit Replace functionality in Excel, but this
does
not work and it says "Cannot find a match".

Also, the total number of rows is variable dependent on the data when
the
application is run. It would not be a good things to do a "select all"
and
have additional rows accidentally introduced into my data.

I've seen something like this used to look at the last row of data to
begin
looking for a range.


'Set WS = Worksheets("Sheet2")
'BottomRowPos = WS.Range("B65536").End(xlUp).Row

Thanks for your help.


"Dave Peterson" wrote:

If you select the range to fix and
Edit|replace
what: (leave blank)
with: Empty
replace all

does it work?

If it does, then you could just hit Edit|Undo and record a macro when
you
do it
manually (one more time).



ALATL wrote:

As simple as this sounds, I can't seem to make this work. I am
looking
for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is
blank. The
range can be variable. The only columns that contain an empty cell
are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.

--

Dave Peterson









  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Enter "Empty" if cell is blank within a variable range

Norman,

This code addressed my issue. I wanted to share it with the grpup.

Best,

Sub Empty_()

Dim LastRow As Long

Sheets("Sheet2").Select
LastRow = ActiveSheet.Range("A65536").End(xlUp).Row

'Process Column B
Range("B2").Select

Do
If Trim(ActiveCell.Text) = "" Then
ActiveCell.Value = "Empty"
End If

ActiveCell.Offset(1, 0).Select

Loop Until ActiveCell.Row = LastRow

'Process Column C
Range("C2").Select

Do
If Trim(ActiveCell.Text) = "" Then
ActiveCell.Value = "Empty"
End If

ActiveCell.Offset(1, 0).Select

Loop Until ActiveCell.Row = LastRow

End Sub


"Norman Jones" wrote:

Hi Alatl,

Try the following version:


'================
Public Sub Tester2()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Const sStr As String = "Empty"

Set WB = Workbooks("MyBook.xls") '<<===== CHANGE
Set SH = WB.Sheets("Sheet1") '<<===== CHANGE

With SH
Set Rng = Intersect(.UsedRange, .Columns("A:B"))
With Rng
.Replace Space(1), vbNullString
.Replace Chr(160), vbNullString
On Error Resume Next
Set Rng = .SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
End With
End With

If Not Rng Is Nothing Then
Rng.Value = sStr
End If
End Sub
'<<================


---
Regards,
Norman



"ALATL" wrote in message
...
Norman,

The MsgBox returns a "False". When I look at the result of the Test
variable
in the debugger, it shows an empty string: " ".

Dim Test As String
Test = Range("B2").Value

I appreciate your feedback!
ALATL



"Norman Jones" wrote:

Hi ATATL,

My suggeste code will populate all empty cells columns A:B,
up to the last used row in the sheet


What response do you get to:

MsgBox IsEmpty(Range("B2")

?


---
Regards,
Norman

"ALATL" wrote in message
...
Dave,

I have checked the value of the cell with the following.

Dim Test As String
Test = Range("B2").Value

The debugger displays an empty string value.

I have tried to use the Edit Replace functionality in Excel, but this
does
not work and it says "Cannot find a match".

Also, the total number of rows is variable dependent on the data when
the
application is run. It would not be a good things to do a "select all"
and
have additional rows accidentally introduced into my data.

I've seen something like this used to look at the last row of data to
begin
looking for a range.


'Set WS = Worksheets("Sheet2")
'BottomRowPos = WS.Range("B65536").End(xlUp).Row

Thanks for your help.


"Dave Peterson" wrote:

If you select the range to fix and
Edit|replace
what: (leave blank)
with: Empty
replace all

does it work?

If it does, then you could just hit Edit|Undo and record a macro when
you
do it
manually (one more time).



ALATL wrote:

As simple as this sounds, I can't seem to make this work. I am
looking
for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is
blank. The
range can be variable. The only columns that contain an empty cell
are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.

--

Dave Peterson







  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Enter "Empty" if cell is blank within a variable range

I'm surprised a simple Edit|Replace didn't work.

Did you try that?

ALATL wrote:

Norman,

This code addressed my issue. I wanted to share it with the grpup.

Best,

Sub Empty_()

Dim LastRow As Long

Sheets("Sheet2").Select
LastRow = ActiveSheet.Range("A65536").End(xlUp).Row

'Process Column B
Range("B2").Select

Do
If Trim(ActiveCell.Text) = "" Then
ActiveCell.Value = "Empty"
End If

ActiveCell.Offset(1, 0).Select

Loop Until ActiveCell.Row = LastRow

'Process Column C
Range("C2").Select

Do
If Trim(ActiveCell.Text) = "" Then
ActiveCell.Value = "Empty"
End If

ActiveCell.Offset(1, 0).Select

Loop Until ActiveCell.Row = LastRow

End Sub

"Norman Jones" wrote:

Hi Alatl,

Try the following version:


'================
Public Sub Tester2()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Const sStr As String = "Empty"

Set WB = Workbooks("MyBook.xls") '<<===== CHANGE
Set SH = WB.Sheets("Sheet1") '<<===== CHANGE

With SH
Set Rng = Intersect(.UsedRange, .Columns("A:B"))
With Rng
.Replace Space(1), vbNullString
.Replace Chr(160), vbNullString
On Error Resume Next
Set Rng = .SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
End With
End With

If Not Rng Is Nothing Then
Rng.Value = sStr
End If
End Sub
'<<================


---
Regards,
Norman



"ALATL" wrote in message
...
Norman,

The MsgBox returns a "False". When I look at the result of the Test
variable
in the debugger, it shows an empty string: " ".

Dim Test As String
Test = Range("B2").Value

I appreciate your feedback!
ALATL



"Norman Jones" wrote:

Hi ATATL,

My suggeste code will populate all empty cells columns A:B,
up to the last used row in the sheet


What response do you get to:

MsgBox IsEmpty(Range("B2")

?


---
Regards,
Norman

"ALATL" wrote in message
...
Dave,

I have checked the value of the cell with the following.

Dim Test As String
Test = Range("B2").Value

The debugger displays an empty string value.

I have tried to use the Edit Replace functionality in Excel, but this
does
not work and it says "Cannot find a match".

Also, the total number of rows is variable dependent on the data when
the
application is run. It would not be a good things to do a "select all"
and
have additional rows accidentally introduced into my data.

I've seen something like this used to look at the last row of data to
begin
looking for a range.


'Set WS = Worksheets("Sheet2")
'BottomRowPos = WS.Range("B65536").End(xlUp).Row

Thanks for your help.


"Dave Peterson" wrote:

If you select the range to fix and
Edit|replace
what: (leave blank)
with: Empty
replace all

does it work?

If it does, then you could just hit Edit|Undo and record a macro when
you
do it
manually (one more time).



ALATL wrote:

As simple as this sounds, I can't seem to make this work. I am
looking
for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is
blank. The
range can be variable. The only columns that contain an empty cell
are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.

--

Dave Peterson








--

Dave Peterson
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Enter "Empty" if cell is blank within a variable range

Dave,

Yes, I did. But the data contained two white spaces. Since I am not
responsible for the data source, I needed code that would trim any number of
white spaces on the cell. That's why I used the trim function.

Best,
ALATL

"Dave Peterson" wrote:

I'm surprised a simple Edit|Replace didn't work.

Did you try that?

ALATL wrote:

Norman,

This code addressed my issue. I wanted to share it with the grpup.

Best,

Sub Empty_()

Dim LastRow As Long

Sheets("Sheet2").Select
LastRow = ActiveSheet.Range("A65536").End(xlUp).Row

'Process Column B
Range("B2").Select

Do
If Trim(ActiveCell.Text) = "" Then
ActiveCell.Value = "Empty"
End If

ActiveCell.Offset(1, 0).Select

Loop Until ActiveCell.Row = LastRow

'Process Column C
Range("C2").Select

Do
If Trim(ActiveCell.Text) = "" Then
ActiveCell.Value = "Empty"
End If

ActiveCell.Offset(1, 0).Select

Loop Until ActiveCell.Row = LastRow

End Sub

"Norman Jones" wrote:

Hi Alatl,

Try the following version:


'================
Public Sub Tester2()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Const sStr As String = "Empty"

Set WB = Workbooks("MyBook.xls") '<<===== CHANGE
Set SH = WB.Sheets("Sheet1") '<<===== CHANGE

With SH
Set Rng = Intersect(.UsedRange, .Columns("A:B"))
With Rng
.Replace Space(1), vbNullString
.Replace Chr(160), vbNullString
On Error Resume Next
Set Rng = .SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
End With
End With

If Not Rng Is Nothing Then
Rng.Value = sStr
End If
End Sub
'<<================


---
Regards,
Norman



"ALATL" wrote in message
...
Norman,

The MsgBox returns a "False". When I look at the result of the Test
variable
in the debugger, it shows an empty string: " ".

Dim Test As String
Test = Range("B2").Value

I appreciate your feedback!
ALATL



"Norman Jones" wrote:

Hi ATATL,

My suggeste code will populate all empty cells columns A:B,
up to the last used row in the sheet


What response do you get to:

MsgBox IsEmpty(Range("B2")

?


---
Regards,
Norman

"ALATL" wrote in message
...
Dave,

I have checked the value of the cell with the following.

Dim Test As String
Test = Range("B2").Value

The debugger displays an empty string value.

I have tried to use the Edit Replace functionality in Excel, but this
does
not work and it says "Cannot find a match".

Also, the total number of rows is variable dependent on the data when
the
application is run. It would not be a good things to do a "select all"
and
have additional rows accidentally introduced into my data.

I've seen something like this used to look at the last row of data to
begin
looking for a range.


'Set WS = Worksheets("Sheet2")
'BottomRowPos = WS.Range("B65536").End(xlUp).Row

Thanks for your help.


"Dave Peterson" wrote:

If you select the range to fix and
Edit|replace
what: (leave blank)
with: Empty
replace all

does it work?

If it does, then you could just hit Edit|Undo and record a macro when
you
do it
manually (one more time).



ALATL wrote:

As simple as this sounds, I can't seem to make this work. I am
looking
for
code for the following:

I would like to enter the word "Empty" into a cell if the cell is
blank. The
range can be variable. The only columns that contain an empty cell
are
columns B or C which can have any number of rows.

I appreciate any suggestions.

Best.

--

Dave Peterson








--

Dave Peterson

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
Cell appears empty, is not "Blank" RJB Excel Discussion (Misc queries) 3 December 5th 07 04:34 PM
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
How do I enter a blank, not "", into a cell with a conditional for edellav Excel Worksheet Functions 2 April 30th 06 08:03 AM
excel formula to enter "0" if cell blank Curt Excel Worksheet Functions 9 November 6th 05 08:24 AM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM


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