Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default If Null Set Value to Zero


Please help me modify the VBA code listed below.

If the value for Volume is Null then return a value of zero.

Thanks,



With Sheets("Sheet1")
.Cells(RowCount, "A") = Team
.Cells(RowCount, "B") = Volume
.Cells(RowCount, "C") = Date
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default If Null Set Value to Zero



With Sheets("Sheet1")
.Cells(RowCount, "A") = Team
.Cells(RowCount, "B") = iif(isnull(Volume) = true,0,Volume)
.Cells(RowCount, "C") = Date
End With


hth

Keith

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default If Null Set Value to Zero

Sub routine()
With Sheets("Sheet1")
.Cells(RowCount, "A") = Team
If Volume = "" Then
.Cells(RowCount, "B") = 0
Else
.Cells(RowCount, "B") = Volume
End If
.Cells(RowCount, "C") = Date
End With
End Sub

--
Gary''s Student - gsnu200755


"Dean P." wrote:


Please help me modify the VBA code listed below.

If the value for Volume is Null then return a value of zero.

Thanks,



With Sheets("Sheet1")
.Cells(RowCount, "A") = Team
.Cells(RowCount, "B") = Volume
.Cells(RowCount, "C") = Date
End With

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
Failed to save table attributes of (null) into (null). Luca Brasi Excel Discussion (Misc queries) 2 February 4th 09 04:30 PM
COUNTIF says Null = Blank but Blank < Null Epinn Excel Worksheet Functions 4 October 25th 06 08:03 PM
Null, "null", vbNull, vbNullString, vbEmpty [email protected] Excel Programming 2 July 25th 06 01:28 PM
cell value based on null/not null in another cell spence Excel Worksheet Functions 1 February 18th 06 11:49 PM
Using Nothing and Null Mikhail Excel Programming 1 October 2nd 03 03:35 AM


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