View Single Post
 
Old 09-17-2013, 08:31 PM
excelledsoftware excelledsoftware is offline Windows 7 64bit Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Quote:
Originally Posted by jonpackbosoxfan View Post
Okay so I generally understand some of the concepts here. The VBA code that is written searches the particular date column and if it comes across any data in that row it records it in the printout sheet starting in Z1 and working on down, pulling the associated name in that row.

I guess where I am struggling is that if it finds nothing in the first row it records noting in Z1 of the printout sheet. So in the case of the date that has been shown it ends up skipping the first 7 lines of the Z column and finally recording the name of Derrick Bishop in Z8.

So in the actual printout what confuses me is how does the formula that is there know to skip the first 7 rows that no data exists and move to row 8. I would think that it would record no data in the first 8 rows. I guess I am really confused by how the formula knows to skip no data.

So then if i added more cells to create additional spaces, and use the fill handle its just going to produce the next number.

Still confused. Thank you for helping me learn this though because it has been interesting. I understand the worksheet a little better, but i admit that while i generally understand the concepts of the VBA code the specifics of the lingo that is being used is way over my head.

Jonathan
Here is my recommendation when it comes to learning VBA or any language for that matter.

All computer languages have functions, methods, variables blah blah blah. What I have found is that you need to program your mind first before programming starts to make sense. Here is my suggestion on what you should learn for VBA and in what order.

1. Macro recording (Start using the macro recorder to do simple operations then look at the code after. Trust me a lot of it wont make sense but some will.
2. Write your first msgbox macro Something simple like
sub boxxy ()
msgbox "Hi there everybody"
end sub

You will notice on the msgbox when typing that it will show you alot more things you can enter. Here is a hint if those things are in [square brackets] they are optional.
3. write your first inputbox macro (Very similar to msgbox)
4. Start understanding variables and datatypes. There is a ton of info out there on these. Use simple ones like strings and integers to begin with.
Example
dim boxxy as string
boxxy = "Here is a message boxy from boxxy"
msgbox boxxy
end sub

5. once you have variables down a little bit start writing if statements. Try it with an input box and a message box.
Start with
sub boxxy ()
dim boxxyPrmpt as integer
boxxyStr = "message 1"
boxxyprmpt = inputbox("Enter a number from 1 to 100")

if boxxyPrmpt > 50 then
msgbox "Higher than 50 entered"
else
msgbox "Less than 50 entered"
end if
end sub

You can even declare 2 more string variables and assign them to the 2 msgbox's

6. Loops learn the For (stands for "For this instance") and Do You will also need to understand the range function and maybe cells
research these and let us know what you run into.

It goes slow at first but gets a lot easier as you go.
Reply With Quote