C# equivilent of Range("iv4").End(xlToLeft).Address

Posted on 2009-04-02
Medium Priority
Last Modified: 2012-06-27
Hello Experts,

I need the c# equivilent of Range("iv4").End(xlToLeft).Address.  It finds the first cell to the left of "iv4" that has data.

Question by:eshurak
1 Comment
LVL 85

Accepted Solution

Rory Archibald earned 2000 total points
ID: 24058386
you need something like this I believe (wks is a worksheet variable):

rng = wks.get_Range("IV4", Type.Missing).get_End(Excel.XlDirection.xlToLeft);

Open in new window


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
As a person who answers a lot of questions, I often see code that could be simplified, made easier to read, and perhaps most importantly made easier to maintain if the code was modified to use the Select Case statement. This article explains how to…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question