Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default R1C1 style reference as Condition


In a macro,
What is the syntax for a conditional line,
the condition being the contents of a cell referred to with the style
RC[-1 ] (same Row as the current cell, but Column one above)?

Something like
------------------------------------------------
If ??????? RC[-1 ] ??? = ""Then
ActiveCell = "The cell above-left is empty"
End If
------------------------------------------------
What should the first half of my 1st line be?

I'll feel very grateful to anyone who can help.
ACA


--
aca
------------------------------------------------------------------------
aca's Profile: http://www.excelforum.com/member.php...o&userid=25933
View this thread: http://www.excelforum.com/showthread...hreadid=539539

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default R1C1 style reference as Condition

If you want the cell above the activecell:
if activecell.offset(-1,0).value = "" then

if you want one column to the left:
if activecell.offset(0,-1).value = "" then

If you want on column to the left and one row up:
if activecell.offset(-1,-1).value = "" then



aca wrote:

In a macro,
What is the syntax for a conditional line,
the condition being the contents of a cell referred to with the style
RC[-1 ] (same Row as the current cell, but Column one above)?

Something like
------------------------------------------------
If ??????? RC[-1 ] ??? = ""Then
ActiveCell = "The cell above-left is empty"
End If
------------------------------------------------
What should the first half of my 1st line be?

I'll feel very grateful to anyone who can help.
ACA

--
aca
------------------------------------------------------------------------
aca's Profile: http://www.excelforum.com/member.php...o&userid=25933
View this thread: http://www.excelforum.com/showthread...hreadid=539539


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default R1C1 style reference as Condition


Thank you David, but your solution is limited to the exemple I gave.
Instead, I am looking for something with general functionnality
like
------------------------------------
If ????? C2R[-1]??? ="" Then
.......
------------------------------------
If the cell in the Row above, but always in Column B, no matter which
column the active cell is in.
ACA


--
aca
------------------------------------------------------------------------
aca's Profile: http://www.excelforum.com/member.php...o&userid=25933
View this thread: http://www.excelforum.com/showthread...hreadid=539539

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default R1C1 style reference as Condition

msgbox activesheet.cells(activecell.row-1,"B").value

maybe...

aca wrote:

Thank you David, but your solution is limited to the exemple I gave.
Instead, I am looking for something with general functionnality
like
------------------------------------
If ????? C2R[-1]??? ="" Then
......
------------------------------------
If the cell in the Row above, but always in Column B, no matter which
column the active cell is in.
ACA

--
aca
------------------------------------------------------------------------
aca's Profile: http://www.excelforum.com/member.php...o&userid=25933
View this thread: http://www.excelforum.com/showthread...hreadid=539539


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default R1C1 style reference as Condition

Thank you David, but your solution is limited to the exemple I gave.

Wow Dave. Need to sharpen those mind reading skills! <LOL

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote in message
...
msgbox activesheet.cells(activecell.row-1,"B").value

maybe...

aca wrote:

Thank you David, but your solution is limited to the exemple I gave.
Instead, I am looking for something with general functionnality
like
------------------------------------
If ????? C2R[-1]??? ="" Then
......
------------------------------------
If the cell in the Row above, but always in Column B, no matter which
column the active cell is in.
ACA

--
aca
------------------------------------------------------------------------
aca's Profile:

http://www.excelforum.com/member.php...o&userid=25933
View this thread:

http://www.excelforum.com/showthread...hreadid=539539

--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default R1C1 style reference as Condition

But I will achieve total consciousness on my deathbed.
So I got that going for me.

Dave "I'm not Kreskin" Peterson



Tom Ogilvy wrote:

Thank you David, but your solution is limited to the exemple I gave.


Wow Dave. Need to sharpen those mind reading skills! <LOL

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote in message
...
msgbox activesheet.cells(activecell.row-1,"B").value

maybe...

aca wrote:

Thank you David, but your solution is limited to the exemple I gave.
Instead, I am looking for something with general functionnality
like
------------------------------------
If ????? C2R[-1]??? ="" Then
......
------------------------------------
If the cell in the Row above, but always in Column B, no matter which
column the active cell is in.
ACA

--
aca
------------------------------------------------------------------------
aca's Profile:

http://www.excelforum.com/member.php...o&userid=25933
View this thread:

http://www.excelforum.com/showthread...hreadid=539539

--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default R1C1 style reference as Condition


Thanks A Lot, Tim:
You've Been Great Help.
Aca


--
aca
------------------------------------------------------------------------
aca's Profile: http://www.excelforum.com/member.php...o&userid=25933
View this thread: http://www.excelforum.com/showthread...hreadid=539539

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
R1C1 reference style Helpme Please[_2_] Excel Discussion (Misc queries) 5 July 11th 07 11:12 PM
can a1 reference style and r1c1 style be used in same formula? rjagga Excel Worksheet Functions 1 September 17th 06 10:58 AM
How to code with the R1C1 Style of Reference? plh Excel Programming 3 April 22nd 06 07:31 PM
R1C1 Reference Style won't STAY gone? khrystle Excel Discussion (Misc queries) 5 March 1st 06 10:36 PM
R1C1 reference style Peg P Excel Discussion (Misc queries) 2 November 15th 05 06:48 PM


All times are GMT +1. The time now is 12:59 AM.

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"