Solved

Finding the first nonblank cell in a row, from a specific position.

Posted on 2014-07-24
3
154 Views
Last Modified: 2014-07-24
C.Offset(0, 5).Value = CH_FinGrp

Using this command to place a value on a sheet from within a For Selection loop.
What if the cell that this is going in is not blank?  How do I tell this to search for the first nonblank cell to the right of (0, 5) and place it there??
0
Comment
Question by:RWayneH
  • 2
3 Comments
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40217114
Slightly confusing question.

What if the cell this is going in is not blank? If so, it is the first nonblank cell. Are you wanting the first BLANK cell to the right?

If so you could increase the Offset command value within a Do Loop

ColOffset = 5
Do Until C.Offset(0,ColOffset).Value = ""
ColOffset = ColOffset + 1
Loop
C.Offset(0,ColOffset).Value = CH_FinGrp

Open in new window


Thanks
Rob H
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 40217120
If it goes one cell too far, might have to put the Until statement after the Loop rather than after the Do

ColOffset = 5
Do 
ColOffset = ColOffset + 1
Loop Until C.Offset(0,ColOffset).Value = ""
C.Offset(0,ColOffset).Value = CH_FinGrp

Open in new window

0
 

Author Closing Comment

by:RWayneH
ID: 40217943
Worked great!!  Thanks.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
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!
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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