Solved

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

Posted on 2014-07-24
3
148 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 31

Expert Comment

by:Rob Henson
Comment Utility
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 31

Accepted Solution

by:
Rob Henson earned 500 total points
Comment Utility
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
Comment Utility
Worked great!!  Thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now