#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Ant ideas?


I will be honest my code writting is very basic, and mostly copied of
other people, or picked up from recorded macro's. Basically i a
looking to do something pretty clever, but i have no idea where t
start. Can anyone write a code to do the following for me?

As it stands i have a macro copying data into cells A:E. At the end o
the macro i have the code - Offset.(1, 0) in order to move down a ro
each time, thus creating an extending list of data.

What i am looking to do is enter a reference number into a cell, the
the macro to look up this refence number and find it in column A
select it, then clear contents of this row for the cells A:E only
After that i need to fnd the very last piece of data in column
(remembering there will now be blanks in the list)and then move down
cell, thus returning to the start point so that more data can be copie
in from the first macro.

As i said, if anyone knows how to do this i will be really grateful.

Tomp

--
Tomp
-----------------------------------------------------------------------
Tompy's Profile: http://www.excelforum.com/member.php...fo&userid=1473
View this thread: http://www.excelforum.com/showthread.php?threadid=26352

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Ant ideas?

Dim res as Variant, rng as Range
res = InputBox("Enter a number")
if res = "" then
msgbox "No entry"
exit sub
End if
if not isnumeric(res) then
msgbox "You must enter a number"
Else
res = clng(res)
set rng = columns(1).find(res)
if not rng is nothing then
rng.Resize(1,5).Clearcontents
Else
msgbox res & " not found"
End if
End if
set rng = cells(rows.count,1).End(xlup)(2)
rng.Select

--
Regards,
Tom Ogilvy

"Tompy" wrote in message
...

I will be honest my code writting is very basic, and mostly copied off
other people, or picked up from recorded macro's. Basically i am
looking to do something pretty clever, but i have no idea where to
start. Can anyone write a code to do the following for me?

As it stands i have a macro copying data into cells A:E. At the end of
the macro i have the code - Offset.(1, 0) in order to move down a row
each time, thus creating an extending list of data.

What i am looking to do is enter a reference number into a cell, then
the macro to look up this refence number and find it in column A,
select it, then clear contents of this row for the cells A:E only.
After that i need to fnd the very last piece of data in column A
(remembering there will now be blanks in the list)and then move down 1
cell, thus returning to the start point so that more data can be copied
in from the first macro.

As i said, if anyone knows how to do this i will be really grateful.

Tompy


--
Tompy
------------------------------------------------------------------------
Tompy's Profile:

http://www.excelforum.com/member.php...o&userid=14732
View this thread: http://www.excelforum.com/showthread...hreadid=263526



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
any ideas if this can be done CarlM[_2_] Excel Worksheet Functions 2 October 27th 09 03:52 PM
Any Ideas? GAIL HORVATH Excel Worksheet Functions 2 May 30th 05 04:17 PM
Any Ideas Greg B Excel Discussion (Misc queries) 7 May 16th 05 03:41 AM
Any ideas? Steph[_3_] Excel Programming 0 May 25th 04 07:48 PM
Any ideas? Steph[_3_] Excel Programming 1 May 25th 04 07:41 PM


All times are GMT +1. The time now is 05:51 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"