LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
RJG RJG is offline
external usenet poster
 
Posts: 19
Default Tweak some code

I found the following code on this board. it searches for a word in a
set column on each worksheet and then copies each row to a new
location. Could anybody suggest how to make the following changes
please.

I need to change two minor items in the code;-
Firstly it starts to outputs to sheet3 A2 and i would like it to start
to output from C17.
Secondly each time the macro is run it adds to the bottom of the
previous run, befor it starts i would like it to delete anything on
sheet3 between C17 and C37.

I would also like to thank the original authorfor a great piece of
code.

Private Sub CommandButton1_Click()
Dim sAdd As String, v As Variant
Dim sh As Worksheet, rng As Range
Dim rng1 As Range, i As Long
v = Array("Sheet1", "Sheet2")
For i = LBound(v) To UBound(v)
Set sh = Worksheets(v(i))
Set rng = sh.Columns(3)
Set rng1 = rng.Find(ComboBox1)
If Not rng1 Is Nothing Then
sAdd = rng1.Address
Do
rng1.EntireRow.Copy Destination:= _
Worksheets("Sheet3").Cells(Rows.Count, 1).End(xlUp)(2)
Set rng1 = rng.FindNext(rng1)
Loop While rng1.Address < sAdd
End If
Next


End Sub
 
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 someone to help tweak a code JB Excel Discussion (Misc queries) 13 January 17th 08 03:04 PM
find multiple values code tweak ToddEZ Excel Programming 5 November 26th 07 08:26 PM
Code Tweak bodhisatvaofboogie Excel Programming 1 July 21st 06 04:37 PM
excel code tweak for outlook - confusing periro16[_2_] Excel Programming 5 August 18th 05 10:29 AM
Need final code tweak Phil Hageman Excel Programming 12 August 16th 03 08:53 PM


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