Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
Macro Help
 
Posts: n/a
Default write macro to input data

I am new at Excel. I want to write a small macro, four or five columns where
I can go to column 1 and input data, then go to column 2 and input date,
etc., then when I get to the end of the fifth column have it return and go to
add more data in column 1. Any help will be appreciated from the experts
in Excel. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Don Guillett
 
Posts: n/a
Default write macro to input data

one way to do this is to use a worksheet_change event
right click sheet tabview codecopy/paste thismodify to suitSAVE

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Row 5 And Target.Column = 8 Then ActiveCell.Offset(1, -6).Select
End Sub



--
Don Guillett
SalesAid Software

"Macro Help" wrote in message
...
I am new at Excel. I want to write a small macro, four or five columns
where
I can go to column 1 and input data, then go to column 2 and input date,
etc., then when I get to the end of the fifth column have it return and go
to
add more data in column 1. Any help will be appreciated from the
experts
in Excel. Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.newusers
VBAvirgin
 
Posts: n/a
Default write macro to input data


This is a basic method, the way I started, before getting into UserForms
etc.
Let's assume, you have some data in columns A thru E (5 columns).

Code:
--------------------
Sub NewData()
Dim Config As Integer
Dim Ans As Integer
Application.ScreenUpdating=False
Range("A1").End(xlDown).Select
'This inserts a value of 1 for tabulation. Use Only if you want to'
ActiveCell.Value=(1)
ActiveCell.Offset(rowOffset:=0,columnOffset:=1).Ac tivate
ActiveCell.Value=InputBox("Enter Your Data")
ActiveCell.Offset(rowOffset:=0,columnOffset:=1).Ac tivate
'Inserts the current date'
ActiveCell.Value=Now
ActiveCell.Offset(rowOffset:=0,columnOffset:=1).Ac tivate
ActiveCell.Value=InputBox("Enter Your Data")
ActiveCell.Offset(rowOffset:=0,columnOffset:=1).Ac tivate
ActiveCell.Value=InputBox("Enter Your Data")
ActiveCell.Offset(rowOffset:=0,columnOffset:=1).Ac tivate
ActiveCell.Value=InputBox("Enter Your Data")
'User is prompted to continue or quit'
Ans=MsgBox("Do You Have Additional Entries?", vbYesNo)
If Ans=vbYes Then
Application.Run("NewData")
End If
'Cursor is returned to the Home Cell of A1'
Application.Range("A1").Select
End Sub

--------------------


Hope this helps you some. I know VBA can be a little initimidating when
you first get into it.
Good Luck in your efforts.


--
VBAvirgin
------------------------------------------------------------------------
VBAvirgin's Profile: http://www.excelforum.com/member.php...o&userid=16327
View this thread: http://www.excelforum.com/showthread...hreadid=496474

  #4   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson
 
Posts: n/a
Default write macro to input data

How about not using a macro?

Data|form might be enough???

And if you want to try creating your own userform, Debra Dalgleish has some
getstarted instructions at:
http://contextures.com/xlUserForm01.html

Macro Help wrote:

I am new at Excel. I want to write a small macro, four or five columns where
I can go to column 1 and input data, then go to column 2 and input date,
etc., then when I get to the end of the fifth column have it return and go to
add more data in column 1. Any help will be appreciated from the experts
in Excel. Thanks.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.newusers
VBAvirgin
 
Posts: n/a
Default write macro to input data


_I_whole-heartedly_agree_ with D. Peterson's comments. Userforms are
definitely the neatest and cleanest way to go.

I was just imagining, from your initial question...(asking for a
macro)...that you may be familiar with some older or different programs
and the macros used within them, such as Lotus 123, or CA SuperCalc, or
QuattroPro (which is what I used last, up until September of 2004).
I'm by no means a programmer of any sorts, but I have now created
userforms, along with my macros, and I'm at a fairly comfortable level,
although I'll be the first to admit there's so much farther to go, but
my point is, the learning curve is only as difficult as you make it, so
hang in there.
It will take some time getting your head around VBA, but I'm sure
you'll do it.

A big help to me has been: "Excel VBA Programming for Dummies"...John
Walkenbach. Wiley Publishing.
That...and the help, such as I have received, from the experts on this
forum.
Good Luck.


--
VBAvirgin
------------------------------------------------------------------------
VBAvirgin's Profile: http://www.excelforum.com/member.php...o&userid=16327
View this thread: http://www.excelforum.com/showthread...hreadid=496474

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
Input cell reference is not valid (One Variable Data Table) Dottore Excel Worksheet Functions 9 September 1st 05 03:05 PM
Printing data validation scenarios SJC Excel Worksheet Functions 14 July 24th 05 12:43 AM
Multiple worksheet queries liam Excel Worksheet Functions 3 February 16th 05 06:52 PM
External data Macro Problem Excel 97 Craig Kelly Excel Discussion (Misc queries) 1 January 17th 05 03:17 PM
Macro does not run when data refreshed Larry Lehman Excel Discussion (Misc queries) 0 January 16th 05 07:31 PM


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