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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: How to create Macro that moves to first empty row. 1

Status
Not open for further replies.

Accel45

Technical User
Jul 7, 2004
83
US
I have a worksheet were I enter small amounts of data over and over.
I set up this macro to enter the data. (Actually I set up two macros: One for “Yes” and one for “No”)

Sub FillItIn()
Range("A3").Select
ActiveCell.FormulaR1C1 = "Joe Blow"
Range("B3").Select
ActiveCell.FormulaR1C1 = "Supervisor"
Range("C3").Select
ActiveCell.FormulaR1C1 = "Yes"
Range("D3").Select
End Sub

What I need is for the Macro to move to the first empty row on the worksheet before executing. As you can see my macro always places the data in the same three cells.
Any help will be appreciated….

Accel45
 


Hi,

VBA/macro question ought to be posted in the VBA Visual Basic for Applications (Microsoft) Forum707
Code:
Sub FillItIn()
    with Range("A65536").End(xlup).offset(1)
       .Value = "Joe Blow"
       .Offset(0,1).Value = "Supervisor"
       .offset(0,2).Value = "Yes"
    end with
End Sub



Skip,

[glasses] [red]Be Advised![/red]
A wee deranged psychic may be runnin' around out there!
SMALL MEDUIM @ LARGE[tongue]
 
And if you want even less lines...... :)

Code:
Sub FillItIn()
    With Range("A65536").End(xlUp).Offset(1).Resize(1, 3)
       .Value = Array("Joe Blow", "Supervisor", "Yes")
    End With
End Sub

Regards
Ken..............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top