OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Move to new cell after input in current cell

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
JayJones
Newbie
Newbie


Joined: 08 Jan 2006
Posts: 3

PostPosted: Fri Jan 30, 2009 10:12 am    Post subject: Move to new cell after input in current cell Reply with quote

I want to simply input data into a cell then move to another cell. The cells are not adjacent. I also want to be able to start in any cell each time, as I save the spreadsheet with the pointer in the last cell. It goes something like right, two right, three right, down one, then six left and quits.

I'm having trouble moving the pointer to a new cell.

The Excel macro was that worked fine;
ActiveCell.Offset(0, 3).Select

according to a site that converts Excel macro's to OO the line below should work.
ThisComponent.getCurrentSelection.Offset(0, 3).Select
However each time I run it I get "BASIC runtime error. Property or method not found.
The line of code prior to that is;
ThisComponent.getCurrentSelection.Value = InputBox("Enter Gross Weight")
And it pops up a window, takes the data I put in and puts it in a cell. I just can't get the pointer to move to a new cell.


The entire Exel macro was:


Sub Macro1()

Message = "Enter Ticket Number" ' Set prompt.
Title = "Ticket" ' Set title.
Ticket = "LA" ' Set default.
MyValue = InputBox(Message, Title)

ActiveCell.Value = Ticket & MyValue
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("Enter Gross Weight")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("Enter Tare")
ActiveCell.Offset(0, 3).Select
ActiveCell.Value = InputBox("Enter MOISTURE")
ActiveCell.Offset(0, 3).Select
ActiveCell.Value = InputBox("Enter Sale Price")
ActiveCell.Offset(0, -1).Select
Message = "Enter Deliver Date, Month and Day " ' Set prompt.
Title = "Delivery Date" ' Set title.
MyStr = InputBox(Message, Title)
If Mid(MyStr, 1, 1) = 1 Then
Else
MyStr = Str(MyStr)
End If


Rem Cell must be format TEXT
If Mid(MyStr, 1, 2) <= 9 Then

MyStr = "0" & Mid(MyStr, 2, 4)
Else
MyStr = Trim(MyStr)
End If


MyStr = Mid(MyStr, 1, 2) & "/" & Mid(MyStr, 3, 2) & "/" & Year(Date)
ActiveCell.Value = MyStr
ActiveCell.Offset(1, 0).Select
ActiveCell.Offset(0, -7).Select

Application.SendKeys "^(b)", True

End Sub
Back to top
View user's profile Send private message
remo00
OOo Enthusiast
OOo Enthusiast


Joined: 21 Dec 2006
Posts: 117

PostPosted: Sat Jan 31, 2009 5:07 pm    Post subject: Reply with quote

I had a similar problem and I solved it.
Have a look in this topic

http://www.oooforum.org/forum/viewtopic.phtml?t=50831&highlight=

Cheers
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group