Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default trying to learn... cannot figure this out, please help!

My pallet numbering problem...


screenshot- http://img267.yfrog.com/img267/1204/screenshotm.jpg

There is a row for every carton. In column A, each row lists the pallet ID number which is the same for every carton on that pallet, then there are two empty rows and the next pallet ID number starts (actually three empty rows after I insert my subtotals that I need). I need to insert a pallet count that displays five rows up and six columns right. New pallet ID numbers are three rows below previous pallet ID numbers, so this is my "g" variable below. I'm trying to compare "e" to "g" and if they are not the same and "g" is not a blank cell, I want it to print the variable "f," which is my pallet count, five rows up and six columns right

I'm really struggling with this code after much research on the internet. I've had some programming, but none in excel VBA, so I'm sure that my syntax is ugly and/or way off, but I really want to learn this stuff because it interests me.



Sub palletnum()

Dim f As Double

Dim g As Double

f = 0

For Each e In Range("a2:a2000")

g = e.Offset(3, 0)

If ((e.Value < g.Value) And (g.Value < 0)) Then

f = f + 1

Range("e.Offset(-5, -1)") = f

End If

Next

End Sub




Anyone that can help me, it would be very, very much appreciated!!


Thanks!

Brandon

EggHeadCafe - Software Developer Portal of Choice
EGGHEADCAFE.COM .NET PROGRAMMING CONTEST
http://www.eggheadcafe.com/tutorials...-net-prog.aspx
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
learn vba vinod9111 Excel Discussion (Misc queries) 4 August 3rd 09 01:31 PM
HOW TO 'BLINK' A FIGURE INSTEAD OFF BOLDING THE FIGURE Nad.Engoor Excel Worksheet Functions 3 December 30th 08 03:04 PM
Learn VB Suleman[_2_] Excel Discussion (Misc queries) 2 May 4th 08 05:11 PM
How to learn VBA Thrava Excel Discussion (Misc queries) 3 January 8th 05 12:43 AM
Trying to Learn VB sowetoddid[_47_] Excel Programming 5 June 21st 04 08:14 PM


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