Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default check for non-blank cells in Microsoft Excel VBA Programming

I am working on a macro in Microsoft Excel 2000 vba.

I want to concatenate the two cells to the left of it.

This is what I have so far:

ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-2],RC[-1])"
Range("E4").Select
Selection.AutoFill Destination:=Range("E4:E6")
Range("E4:E6").Select
Range("E7").Select
End Sub

How do I run the same macro, but have it check to the cell left of it?

If the cell to the left of it has a value in it, I want it to
concatenate.

If the cell is a *null* or *blank cell*, I want the sub to stop.

How do I do it?

Thank you in advance for your help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default check for non-blank cells in Microsoft Excel VBA Programming

Hi rhodyma
try this

Sub h()
If ActiveCell.Offset(0, -1) "" Then
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-2],RC[-1])"
Range("E4").AutoFill Destination:=Range("E4:E6")
Range("E7").Select
Else
Exit Sub
End If
End Sub

if activecell = Range("E4") then cange it to
Range("E4") .Offset(0, -1) "" Then
Range("E4").FormulaR1C1 = "=CONCATENATE(RC[-2],RC[-1])"

Regards Yngve

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
Check for Non Blank and Blank Cells Before Save igbert Excel Discussion (Misc queries) 2 July 2nd 09 08:36 PM
How to check for blank cells with formula Bob Flanagan[_2_] Excel Discussion (Misc queries) 3 January 7th 09 04:12 AM
Using Vlookup and IF statements to check for blank cells Koomba Excel Worksheet Functions 4 September 27th 08 03:54 PM
check for two blank cells before populating a 3rd. slinger Excel Worksheet Functions 6 October 25th 06 08:14 PM
Check for References to Blank Cells ExcelMonkey Excel Programming 7 July 25th 05 06:31 PM


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