Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nigel
 
Posts: n/a
Default Adding Row to this macro

Hi,
I have this macro which runs in a routine on a hidden sheet when a button is
pressed.

iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

Can anyone help me to carry out the following?
When it has found the next available cell on the hidden sheet, i would like
it to add a row. Help mist graciously appreciated.


nigel
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
ws.rows(iRow).Insert

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Nigel" wrote in message
...
Hi,
I have this macro which runs in a routine on a hidden sheet when a button

is
pressed.

iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

Can anyone help me to carry out the following?
When it has found the next available cell on the hidden sheet, i would

like
it to add a row. Help mist graciously appreciated.


nigel



  #3   Report Post  
Don Guillett
 
Posts: n/a
Default

try one of these

Sub addrow()
Set ws = Sheets(4)
ws.Rows(ws.Cells(Rows.Count, 1).End(xlUp).Row).Insert
End Sub

Sub addrow1()
With Sheets(4)
..Rows(.Cells(.Rows.Count, 1).End(xlUp).Row).Insert
End With
End Sub
--
Don Guillett
SalesAid Software

"Nigel" wrote in message
...
Hi,
I have this macro which runs in a routine on a hidden sheet when a button

is
pressed.

iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

Can anyone help me to carry out the following?
When it has found the next available cell on the hidden sheet, i would

like
it to add a row. Help mist graciously appreciated.


nigel



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding apostrophe macro? GolfGal Excel Discussion (Misc queries) 2 April 24th 05 04:39 PM
Adding info in the row at the bottom using macro? Carrie Excel Discussion (Misc queries) 1 April 14th 05 04:18 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
macro - adding rows to a column that is summed HGood Excel Discussion (Misc queries) 2 December 1st 04 03:28 PM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"