Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Populating column N where is is blank or null


I would like to write a macro that writes a formula in
Column N if:
i)Column A and Column H are not null/blank
ii)Column N is currently blank/null
It is important that the macro does not overwrite
values/formulas that are already in other rows of column H.

The formula should be column G minus column C

Thank you very much in advance.

Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Populating column N where is is blank or null

Hi
try the following macro:
Sub process_rows()
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For row_index = 1 to lastrow
If Cells(row_index, 1).Value <"" and _
Cells(row_index, 8).Value <"" and _
cells(row_index,14).value="" then
cells(row_index,14).formulaR1C1="=R[0]C7-R[0]C3"
End If
Next
Application.ScreenUpdating = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

"Steve" schrieb im Newsbeitrag
...

I would like to write a macro that writes a formula in
Column N if:
i)Column A and Column H are not null/blank
ii)Column N is currently blank/null
It is important that the macro does not overwrite
values/formulas that are already in other rows of column H.

The formula should be column G minus column C

Thank you very much in advance.

Steve


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
Need help with Formula. Need it to return Null, not Blank Aled Davies Excel Discussion (Misc queries) 0 January 27th 11 04:20 PM
COUNTIF says Null = Blank but Blank < Null Epinn Excel Worksheet Functions 4 October 25th 06 08:03 PM
Populating column N with a formula if column A is Null or Blank Steve Excel Programming 4 September 28th 04 01:50 PM
Set a cell to blank (Null) Bill Agee Excel Programming 1 August 19th 04 08:23 PM
How to refer to a blank/null value? desmondleow[_11_] Excel Programming 6 December 29th 03 01:36 PM


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