Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default create worksheet and insert row

hi,
having problems with this part of my function to open a new
worksheet if it's the first time it executes, and then write a new row.
and all subsequent times I execute it, it will write in another new row
of info.

All help appreciated!! Thanks


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default create worksheet and insert row


Private wksMyNewSheet As Worksheet

Sub test()
Dim i As Long

If wksMyNewSheet Is Nothing Then
Set wksMyNewSheet = Worksheets.Add
wksMyNewSheet.Name = "My New Sheet"
End If

With wksMyNewSheet
With .UsedRange
On Error Resume Next
i = 1: i = .Find("*", .Cells(1), xlFormulas, xlWhole, xlByRows,
xlPrevious).Row + 1
On Error GoTo 0
End With
.Cells(i, 1).Value = "New Entry: " & Format(Now(), "hh:mm:ss")
End With
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"junx13 " wrote in message
...
hi,
having problems with this part of my function to open a new
worksheet if it's the first time it executes, and then write a new row.
and all subsequent times I execute it, it will write in another new row
of info.

All help appreciated!! Thanks


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default create worksheet and insert row

Thanks Rob!!


---
Message posted from http://www.ExcelForum.com/

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
Need Macro to create a new worksheet and insert image [email protected] Excel Discussion (Misc queries) 3 March 31st 10 08:18 PM
Cannot insert worksheet in exel - not available in insert menu pedro39 Excel Worksheet Functions 1 July 24th 08 12:09 PM
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 lukerush Excel Worksheet Functions 2 September 7th 06 05:05 PM
How to create a form to insert a hyerlink.VBA code to create a for karthi Excel Discussion (Misc queries) 0 July 5th 06 11:26 AM
Can I auto insert a worksheet when I insert a value in a cell. iainc Excel Worksheet Functions 0 April 27th 06 08:37 AM


All times are GMT +1. The time now is 04:12 AM.

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

About Us

"It's about Microsoft Excel"