Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Find a cell that contains ?? - Log Creation and Updating

I am looking to create a log that has three stages. When the user completes
the first stage the information is written to a spreadsheet on the next empty
Row. I know how to do this bit. At a point in the future a different user
will then complete stage two and the subsequent information needs to be added
to the existing log.

I can ensure that any different user links to the same spreadsheet but what
I am struggling on is getting the macro to find the right row. The first
cell in the row will be a unique identifier that will be present throughout
the three stages.

So what I am asking is the code for : Search Column A for a cell that
contains ABC123. When found select this Row, Column 5, then Column 6 etc etc.

I hope that is clear and someone is able to help!

Thanks in Advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Find a cell that contains ?? - Log Creation and Updating

Try the below macro

Sub Macro()

Dim varFound As Variant, varSearch As Variant
varSearch = "ABC123"
Set varRange = Sheets("Sheet1").Columns(1)
Set varFound = varRange.Find(varSearch, LookAt:=xlWhole)
If Not varFound Is Nothing Then
lngLastCol = ActiveSheet.Cells(varFound.Row, _
Columns.Count).End(xlToLeft).Column
Cells(varFound.Row, lngLastCol + 1) = "write log"
End If

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"BaggieDan" wrote:

I am looking to create a log that has three stages. When the user completes
the first stage the information is written to a spreadsheet on the next empty
Row. I know how to do this bit. At a point in the future a different user
will then complete stage two and the subsequent information needs to be added
to the existing log.

I can ensure that any different user links to the same spreadsheet but what
I am struggling on is getting the macro to find the right row. The first
cell in the row will be a unique identifier that will be present throughout
the three stages.

So what I am asking is the code for : Search Column A for a cell that
contains ABC123. When found select this Row, Column 5, then Column 6 etc etc.

I hope that is clear and someone is able to help!

Thanks in Advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Find a cell that contains ?? - Log Creation and Updating

Example code:

Dim rng As Range, sh As Worksheet
Set sh = Sheets("Somesheet")
Set rng = sh.Range("A2", sh.Cells(Rows.Count, 1). End(xlUp))
Set newRng = rng.Find(ABC123, LookIn:=xlValues)
Set col5 = newRng.Offset(0, 4)
Set col6 = newRng.Offset(0, 5)
col5.Select
col6.Select



"BaggieDan" wrote in message
...
I am looking to create a log that has three stages. When the user
completes
the first stage the information is written to a spreadsheet on the next
empty
Row. I know how to do this bit. At a point in the future a different
user
will then complete stage two and the subsequent information needs to be
added
to the existing log.

I can ensure that any different user links to the same spreadsheet but
what
I am struggling on is getting the macro to find the right row. The first
cell in the row will be a unique identifier that will be present
throughout
the three stages.

So what I am asking is the code for : Search Column A for a cell that
contains ABC123. When found select this Row, Column 5, then Column 6 etc
etc.

I hope that is clear and someone is able to help!

Thanks in Advance



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Find a cell that contains ?? - Log Creation and Updating

Thanks to you both, I don't like asking for code without having a go first
but that, as simple as it now seems, had me stumped for a while.

Cheers!

"JLGWhiz" wrote:

Example code:

Dim rng As Range, sh As Worksheet
Set sh = Sheets("Somesheet")
Set rng = sh.Range("A2", sh.Cells(Rows.Count, 1). End(xlUp))
Set newRng = rng.Find(ABC123, LookIn:=xlValues)
Set col5 = newRng.Offset(0, 4)
Set col6 = newRng.Offset(0, 5)
col5.Select
col6.Select



"BaggieDan" wrote in message
...
I am looking to create a log that has three stages. When the user
completes
the first stage the information is written to a spreadsheet on the next
empty
Row. I know how to do this bit. At a point in the future a different
user
will then complete stage two and the subsequent information needs to be
added
to the existing log.

I can ensure that any different user links to the same spreadsheet but
what
I am struggling on is getting the macro to find the right row. The first
cell in the row will be a unique identifier that will be present
throughout
the three stages.

So what I am asking is the code for : Search Column A for a cell that
contains ABC123. When found select this Row, Column 5, then Column 6 etc
etc.

I hope that is clear and someone is able to help!

Thanks in Advance



.

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
calculator creation, find missing value philr Excel Worksheet Functions 1 December 7th 09 03:06 PM
Date Creation in Cell Dayne Dillon Excel Worksheet Functions 2 June 20th 06 12:03 PM
Day before creation date in cell or as sheet name No Name Excel Programming 9 May 8th 06 06:09 AM
Creation date in cell No Name Excel Programming 5 March 14th 06 09:39 AM
Creation date in cell No Name Excel Programming 2 March 10th 06 05:26 PM


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