Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shifting the contents of a table 1 row down..

Status
Not open for further replies.

kragster

Technical User
May 9, 2007
55
DK
Hi.
Can someone help me create a macro for a button, that shifts all content in a range (table) one row down? Thanks in advance.
 
Have you tried the macrorecorder ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 




Hi,
Why shift data in a table? Presumably its to create a new line for data entry. Why not just enter the data at the bottom of the table? There are good reasons to AVOID INSERT. It seems handy, but at times makes things complicated.

Skip,

[glasses] [red][/red]
[tongue]
 
Hi Skip,
Exactly. Im making a purchase table and wanted to create an entryfield and a submit button, that inserted the data from the entryfield into the top row of the table ;) Is it possible instead to insert the entryfield into the first empty row of the table?
 
If the existing data are contiguous, usedrange might work nicely for you:
Code:
newrow = usedrange.rows.count + 1
assuming the used range starts in row-1.

_________________
Bob Rashkin
 
Hmm, what I have done now is to make a variable for each cell in the entryfield. What I would like to do, is to find the first empty row in a range, and insert the variable into the appropriate cells. How do I find the first empty row in a range?
 




Code:
set rNextEmptyCell = oFirstCellInRange.End(xlDown).offset(1)

Skip,

[glasses] [red][/red]
[tongue]
 
Hi kragster:

If you are looking for the row number next to CurrentRegion associated with the ActiveCell, then try ...
Code:
nextEmptyrow=activecell (activecell.CurrentRegion.Rows.count +1 ).row

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top