Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving Between worksheets


I am in worksheet "Test", and the following code is within thi
worksheet,
a problem arises when I move to another worksheet "shell (S)"
I get message "Run-time error '1004' Application-defined o
object-defined error' which I believe is with the asterixed line.


Sub printtariq()

a = Cells.Find("WorkOrder").Column
b = Cells.Find("CostC").Column
c = Cells.Find("PaperSize").Column
d = Cells.Find("PaperWeight").Column
e = Cells.Find("NoBW").Column
f = Cells.Find("printtype").Column

lastrow = Range("A65500").End(xlUp).Row
lastcol = Range("IV1").End(xlToLeft).Column
Cells(1, lastcol + 1) = "x"
Cells(1, lastcol + 1).Font.Bold = True
g = Cells.Find("x").Column

'For i = 2 To lastrow
'Cells(i, g) = Right(Cells(i, a), Len(Cells(i, a)) - 1)
'Next


***Sheets("shell (S)").Range("D23").Select












End Su

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56656

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving Between worksheets


are you tiding up the sheet after processing by using this line?


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=566560

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving Between worksheets


Sorry Matt, fidnt understand your question.
After doing my processing within the "Test" worksheet I am
then moving to the "shell(S) " worsheet.
Hope that help

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56656

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving Between worksheets


That's ok.

You could try this alternative instead...

Sub printtariq()
Dim xlRng as range
set xlRng = activecell

Then when you finished all the processes...

activecell.selec

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=56656

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving Between worksheets


Hi trying the following based on your premise, not working, i a
obviously doing something wrong

Sub printtariq()

Dim xlRng As Range
Set Sheets("MORI WIP (S)").Range("D23") = ActiveCell


a = Cells.Find("WorkOrder").Column
b = Cells.Find("CostC").Column
c = Cells.Find("PaperSize").Column
d = Cells.Find("PaperWeight").Column
e = Cells.Find("NoBW").Column
f = Cells.Find("printtype").Column

lastrow = Range("A65500").End(xlUp).Row
lastcol = Range("IV1").End(xlToLeft).Column
Cells(1, lastcol + 1) = "x"
Cells(1, lastcol + 1).Font.Bold = True
g = Cells.Find("x").Column

'For i = 2 To lastrow
'Cells(i, g) = Right(Cells(i, a), Len(Cells(i, a)) - 1)
'Next


ActiveCell.Select
'Cells(2, 9) = Replace(Cells(2, 1), 1, 1, "S"

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56656



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving Between worksheets


Actaully , inserted code in workbook macro and works fine now, thank

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56656

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
moving worksheets mike Excel Discussion (Misc queries) 1 July 24th 09 09:04 PM
Moving between worksheets Damon Excel Discussion (Misc queries) 3 July 7th 06 05:31 PM
Moving all worksheets jerredjohnson Excel Discussion (Misc queries) 1 June 15th 06 06:01 PM
Moving between Worksheets Jim Berglund Excel Programming 5 August 17th 04 06:21 PM
Moving Between Worksheets Lee Excel Programming 3 February 16th 04 08:52 PM


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