Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default goto next line

dim DataWks as worksheet
dim res as variant 'could be an error
dim myKey as string
dim NextRow as long

set datawks = worksheets("Data")
mykey = "idnumbergoesheresomehow"

with datawks
'key is in column A of
res = application.match(mykey,.range("a:a"),0)
if iserror(res) then
'key not in column A of data worksheet
nextrow = .cells(.rows.count,"A").end(xlup).row + 1
'plop the values in
.cells(nextrow,"A").value = mykey
.cells(nextrow,"B").value = "somethingelse"
....
else
'key is in column A and is in row # res
end if



Miree wrote:

I am new to macros and the like.

I have a pretty input sheet for people to put data in, I need to export it
in to another work sheet(i know to do this) but the form gets cleared and
more data added. I need the data to be entered into the next blank line,
this i dont know how to do. The data also has an identifier number I need
there to be a check that the number doesnt already exist in the stored data,
if it is i need the option to overwrite data or give to it the next number in
the series new numer.

I would like an explination of the code if possible, rather than a cut and
paste job.

Thank you


--

Dave Peterson
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
How to convert a dotted line to a solid line in a line graph Sharlz Charts and Charting in Excel 1 January 14th 09 04:51 AM
advanced filter, goto next line(record) Pierre[_18_] Excel Programming 6 December 20th 07 06:14 PM
Macro problem on, Yellowed line - previous line or next line. Ed Excel Programming 7 March 29th 05 09:37 PM
On Error Goto doesn't goto Paul Excel Programming 1 October 15th 04 03:51 PM
On Error Goto doesn't goto Paul Excel Programming 0 October 15th 04 03:05 PM


All times are GMT +1. The time now is 02:59 AM.

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"