×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Data to Sequential Cells

Data to Sequential Cells

Data to Sequential Cells

(OP)
I am writing a sheet to handle slope staking data and I need to get my information from my user form to the cell. But I need it to perform a loop function so that when I input the next stations values it will insert the data to the next set of cells. Any suggestions would be helpful.

Thanks Tim

RE: Data to Sequential Cells

Without knowing too much of what your trying to do, i think a version of vlookup would suffice, this can be found under INsert -> function.

Vlookups are good for picking out a single cell ref i.i a station number, and then in cells you choose on antoher sheet it will fill out data taken from across the original cell.

the only caveat is that the cells that the vlooup is performed on has to be in some type of sequential order, or you have to use the false command at the end of the formula.

RE: Data to Sequential Cells

I do this in Quattro by re-naming the input cell which I have reached.  The macro runs the same steps each time but find the named cell when the input comes around.  The last step in my "do loop" visits the specific named cell, drops one cell on the sheet and then renames that cell.  I'm more familiar with Quattro macros than Excel but I'm sure the same logic will work.
You could also name all the possible input cells ahead of time including a row number and then coordinate that with the macro loop count.

RE: Data to Sequential Cells

(OP)
I guess what I was asking was how would I write a loop statement into my vba macro so that when I began inputing data for my next station it would automaticaly move to the next cell. I have it to where I input the desired cell before the data is input but that gets a little tedious when I have more than 3 or 4 hundred ft of slope stake data if the vloop can be set to repeat a certain # of times then that would be fine

RE: Data to Sequential Cells

I hope I'm on the right track here, this is a simple loop to find the next empty cell in a row or column. Assumming the data is in column B (2 in macro) and the data will be in rows 10 to 110.

   For x = 10 to 110
       If IsEmpty(Cells(x,2))then goto exit1
   next x
exit1:

you can then use the VB to put the value you require into the next empty cell Cells(x,2)

RE: Data to Sequential Cells

(OP)
Thanks to all you guys and gals ( just to be safe ) I went back and re sized my sheet. Then I just included a call for each cell in order of use. It made for some long code but I am not using more than 4 cells and maybe 20 rows. I think I am going to try Buffo method to see if it is any easier.

 Tim

RE: Data to Sequential Cells

You can also just use a row counter, assuming each loop is in the next row.

Dim iRow As Long
iRow = 2 'First row for data

start loop...

   Range("A" & iRow) = Text1.Text
   Range("B" & iRow) = Text2.Text
   Range("C" & iRow) = Text3.Text
   iRow = iRow + 1

end loop...

Not sure if that's what you were after...

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close