Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A Simple(?) Macro Question


I'm a newbie. I just learned of this forum.

I'm struggling with macros in Excel. I want to do a few very simple
operations
a couple million times. I need to mechanize the process.

I can do some simple stuff, like "multiply the numbers in that column
by this
number." But then I'm stuck on how to maneuver to a different position
& do the same operation again. In Lotus, I could use RIGHT, DOWN, END &
stuff like that. I'm not having much luck with Excel (&, I assume,
VBA).

I was surprised that I couldn't attach an Excel spreadsheet to this
message. (Maybe there's a trick to learn.) I've attached it as .pdf.
I hope I've explained what I want to do. The example is trivial. But
doing it a million times without a macro would be a bother.

It would certainly be easiest if someone could return an Excel
spreadsheet. Then I could fool with the code & get to my real problem.


Thanks,

DJQ


+-------------------------------------------------------------------+
|Filename: Excel Question 04-21-06.pdf |
|Download: http://www.excelforum.com/attachment.php?postid=4676 |
+-------------------------------------------------------------------+

--
DaveJones39
------------------------------------------------------------------------
DaveJones39's Profile: http://www.excelforum.com/member.php...o&userid=33734
View this thread: http://www.excelforum.com/showthread...hreadid=535128

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default A Simple(?) Macro Question

Assume that horizontal numbers start in B1 and the vertical numbers start in
A2

Option Explicit
Sub BuildData()
Dim cnt As Long, i As Long, j As Long
Dim bMatch As Boolean, lastrow As Long
Dim lastCol As Long
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
lastCol = Cells(1, Columns.Count _
).End(xlToLeft).Column
cnt = 1
For j = 2 To lastCol
bMatch = False
For i = 2 To lastrow
If Cells(i, 1).Value = Cells(1, j).Value Then
bMatch = True
End If
If bMatch Then
Cells(i, j).Value = Cells(i, 1).Value _
* Cells(1, j).Value
Cells(cnt, lastCol + 2).Value = _
Cells(i, j).Value
cnt = cnt + 1
End If
Next
Next

End Sub


--
Regards,
Tom Ogilvy



"DaveJones39"
wrote in message
...

I'm a newbie. I just learned of this forum.

I'm struggling with macros in Excel. I want to do a few very simple
operations
a couple million times. I need to mechanize the process.

I can do some simple stuff, like "multiply the numbers in that column
by this
number." But then I'm stuck on how to maneuver to a different position
& do the same operation again. In Lotus, I could use RIGHT, DOWN, END &
stuff like that. I'm not having much luck with Excel (&, I assume,
VBA).

I was surprised that I couldn't attach an Excel spreadsheet to this
message. (Maybe there's a trick to learn.) I've attached it as .pdf.
I hope I've explained what I want to do. The example is trivial. But
doing it a million times without a macro would be a bother.

It would certainly be easiest if someone could return an Excel
spreadsheet. Then I could fool with the code & get to my real problem.


Thanks,

DJQ


+-------------------------------------------------------------------+
|Filename: Excel Question 04-21-06.pdf |
|Download: http://www.excelforum.com/attachment.php?postid=4676 |
+-------------------------------------------------------------------+

--
DaveJones39
------------------------------------------------------------------------
DaveJones39's Profile:

http://www.excelforum.com/member.php...o&userid=33734
View this thread: http://www.excelforum.com/showthread...hreadid=535128



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A Simple(?) Macro Question


It says this is a reply to the thread. I'm a little put off by the new
title.

I had a 'simple(?)' macro question. Tom O. responded & I don't see his
e-mail addy, to allow me a private 'Thank you.' So, I'll post it here.


Thanks, Tom. (Geez. This stuff doesn't look simple at all. I've got
some work to do!)


--
DaveJones39
------------------------------------------------------------------------
DaveJones39's Profile: http://www.excelforum.com/member.php...o&userid=33734
View this thread: http://www.excelforum.com/showthread...hreadid=535128

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default A Simple(?) Macro Question

probably 95% of the responses that you see in the Excel forum are coming
from the UseNet news group and not from members of the Excel Forum. Those
people responding probably have no knowledge of the Excel forum or what you
are seeing in the Excel forum.

news://msnews.microsoft.com/microsof...el.programming

--
Regards,
Tom Ogilvy



"DaveJones39"
wrote in message
...

It says this is a reply to the thread. I'm a little put off by the new
title.

I had a 'simple(?)' macro question. Tom O. responded & I don't see his
e-mail addy, to allow me a private 'Thank you.' So, I'll post it here.


Thanks, Tom. (Geez. This stuff doesn't look simple at all. I've got
some work to do!)


--
DaveJones39
------------------------------------------------------------------------
DaveJones39's Profile:

http://www.excelforum.com/member.php...o&userid=33734
View this thread: http://www.excelforum.com/showthread...hreadid=535128



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A Simple(?) Macro Question


This is a new neighborhood (world) for me.

Tom O. mentioned "probably 95% of the responses that you see in the
Excel forum are coming from the UseNet news group and not from members
of the Excel Forum." That's a mystery to me. Are Excel Forum
questions posted in some broader, public forum (UseNet)? Or is this a
HELP function sponsored by MS? I see same individuals responding to
several different Excel Forum queries. Are these folks simply Good
Samaritans, or are they sponsored or paid to do this good work?

(Assuming that Tom O. is a human & not a computer-generated responder,
I'd appreciate a private e-mail so that I could make (brief) contact.)


--
DaveJones39
------------------------------------------------------------------------
DaveJones39's Profile: http://www.excelforum.com/member.php...o&userid=33734
View this thread: http://www.excelforum.com/showthread...hreadid=535128



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
Simple Macro Question Gunti Excel Discussion (Misc queries) 17 December 19th 08 03:53 PM
simple macro question Roger Excel Worksheet Functions 2 January 24th 07 10:29 PM
question about syntax in a simple macro... Dave F Excel Discussion (Misc queries) 3 November 3rd 06 02:12 PM
Macro question - I'm sure it's simple... chrisgoulden Excel Discussion (Misc queries) 3 February 23rd 06 04:01 PM
Simple Macro Question Jason R Excel Programming 4 May 26th 05 03:42 PM


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