LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Anthony
 
Posts: n/a
Default re Macro - too hard for me !!

Thanks to those who offered help but I still am not quite there with the
correct solution.
R.Venkataraman's code was almost correct but I don't think I explained
myself correctly.
In my sheet1 the user inputs numbers (1-50) in column A.(pluss loads of
other data in columns B:P) what I require is the macro to ask the user to
input the 'job' they want to print. So if the user inputs <9 then column A
in sheet 1 is searched for the number 9 then the contents of that particular
row are copied (without formula - just cell values) and the data pasted onto
row A2 of sheet 2.
Each time the button is selected the data is always pasted to the same cell
ref in sheet 2, thus overwriting any data already there.

The code I have so far is this,

Sub test()
Dim i As Integer
Dim wks1 As Worksheet, wks2 As Worksheet, wks3 As Worksheet
Dim lLastRow As Long
On Error GoTo err_handler
Set wks1 = Worksheets("sheet1")
Set wks2 = Worksheets("sheet2")
Set wks3 = Worksheets("sheet3")
i = InputBox("type the row number desired")
Worksheets("sheet1").Activate
ActiveSheet.Cells(i, 1).EntireRow.Copy Destination _
:=Worksheets("sheet2").Cells(i, 1)

wks3.PrintOut preview:=True
Exit Sub

err_handler:
MsgBox "An error has ocurred, please try again"
End Sub


but if the user enters <9 as his/her selected request row A9 is copied and
pasted. I want column A to be searched for the number <9 then whatever row
this is, (any row from A5:A1000) copy this whole row and paste it into A2 of
sheet 2.
Sorry for the waffle but please can anybody help, as my head hurts!!!
many thanks
Anthony
 
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
Macro - Too hard for me!! Anthony Excel Discussion (Misc queries) 3 February 27th 05 07:11 AM
Macro - Too hard for me!! Anthony Excel Discussion (Misc queries) 0 February 27th 05 12:55 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


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