Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Vlookup and print loop

Hi,

I have a sheet that uses a lookup table to fill in values the sheet is then
printed.

I would like to loop the sheet so that I am able to print several sheets if
needed, I thought the best way to achieve this would be to add a checkbox
next to each record, where there is tick (true) that record needs to be
printed, - is this possible?

Sheet1 - page to be printed dropdown list located at cell a14 which looks up
the value on sheet2 column A

Sheet2 - contains the lookup table

A B C D
E F G (checkbox with link
to cell - true/false)

a001 something something something something
something checkbox (True/False)
a002 something something something something
something checkbox (True/False)
a003 something something something something
something checkbox (True/False)
a004 something something something something
something checkbox (True/False)
a005 something something something something
something checkbox (True/False)
etc

Thanks in advance!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Vlookup and print loop

Don,

I understand what you are doing (I think!) and also have the code to print,

How do I loop my range for only the certain column

ie the vlookup refers to column A in the table to but the 'x' is in colmun
G?

I can use the to input the value :
lookuptablevalue = relevant row Column A value


sheets("sheet1").Range("A14").value = lookuptablevalue



Also the print command is

ActiveWindow.Selectedsheets.PrintOut Copies:=1, Collate:=True

Is there a way batch these altogether - not a problem if it is not possible,
just if it is.

Thanks




"Don Guillett" wrote in message
...
Why not be a bit simpler. Just put an x (or even anything) in the cell to
print

Sub printif()
mc = "k"
For i = 1 To Cells(rows.Count, mc).End(xlUp).Row
If Len(Application.Trim(Cells(i, mc))) 0 Then
'do your thing
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MM User" wrote in message
...
Hi,

I have a sheet that uses a lookup table to fill in values the sheet is
then printed.

I would like to loop the sheet so that I am able to print several sheets
if needed, I thought the best way to achieve this would be to add a
checkbox next to each record, where there is tick (true) that record
needs to be printed, - is this possible?

Sheet1 - page to be printed dropdown list located at cell a14 which looks
up the value on sheet2 column A

Sheet2 - contains the lookup table

A B C D E F
G (checkbox with link to cell - true/false)

a001 something something something something
something checkbox (True/False)
a002 something something something something
something checkbox (True/False)
a003 something something something something
something checkbox (True/False)
a004 something something something something
something checkbox (True/False)
a005 something something something something
something checkbox (True/False)
etc

Thanks in advance!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Vlookup and print loop

If Len(Application.Trim(Cells(i, mc))) 0 Then
If Len(Application.Trim(Cells(i, mc).offset(0,5))) 0 Then

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MM User" wrote in message
...
Don,

I understand what you are doing (I think!) and also have the code to
print,

How do I loop my range for only the certain column

ie the vlookup refers to column A in the table to but the 'x' is in colmun
G?

I can use the to input the value :
lookuptablevalue = relevant row Column A value


sheets("sheet1").Range("A14").value = lookuptablevalue



Also the print command is

ActiveWindow.Selectedsheets.PrintOut Copies:=1, Collate:=True

Is there a way batch these altogether - not a problem if it is not
possible, just if it is.

Thanks




"Don Guillett" wrote in message
...
Why not be a bit simpler. Just put an x (or even anything) in the cell to
print

Sub printif()
mc = "k"
For i = 1 To Cells(rows.Count, mc).End(xlUp).Row
If Len(Application.Trim(Cells(i, mc))) 0 Then
'do your thing
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MM User" wrote in message
...
Hi,

I have a sheet that uses a lookup table to fill in values the sheet is
then printed.

I would like to loop the sheet so that I am able to print several sheets
if needed, I thought the best way to achieve this would be to add a
checkbox next to each record, where there is tick (true) that record
needs to be printed, - is this possible?

Sheet1 - page to be printed dropdown list located at cell a14 which
looks up the value on sheet2 column A

Sheet2 - contains the lookup table

A B C D E F G
(checkbox with link to cell - true/false)

a001 something something something something
something checkbox (True/False)
a002 something something something something
something checkbox (True/False)
a003 something something something something
something checkbox (True/False)
a004 something something something something
something checkbox (True/False)
a005 something something something something
something checkbox (True/False)
etc

Thanks in advance!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Vlookup and print loop

Apologies Don,

I still cannot get this working it keeps looping but even if I have an x or
k in the G column it skips?

I'm not sure if the it goes to the next row etc?

Regards,




"Don Guillett" wrote in message
...
If Len(Application.Trim(Cells(i, mc))) 0 Then
If Len(Application.Trim(Cells(i, mc).offset(0,5))) 0 Then

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MM User" wrote in message
...
Don,

I understand what you are doing (I think!) and also have the code to
print,

How do I loop my range for only the certain column

ie the vlookup refers to column A in the table to but the 'x' is in
colmun G?

I can use the to input the value :
lookuptablevalue = relevant row Column A value


sheets("sheet1").Range("A14").value = lookuptablevalue



Also the print command is

ActiveWindow.Selectedsheets.PrintOut Copies:=1, Collate:=True

Is there a way batch these altogether - not a problem if it is not
possible, just if it is.

Thanks




"Don Guillett" wrote in message
...
Why not be a bit simpler. Just put an x (or even anything) in the cell
to print

Sub printif()
mc = "k"
For i = 1 To Cells(rows.Count, mc).End(xlUp).Row
If Len(Application.Trim(Cells(i, mc))) 0 Then
'do your thing
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MM User" wrote in message
...
Hi,

I have a sheet that uses a lookup table to fill in values the sheet is
then printed.

I would like to loop the sheet so that I am able to print several
sheets if needed, I thought the best way to achieve this would be to
add a checkbox next to each record, where there is tick (true) that
record needs to be printed, - is this possible?

Sheet1 - page to be printed dropdown list located at cell a14 which
looks up the value on sheet2 column A

Sheet2 - contains the lookup table

A B C D E F G
(checkbox with link to cell - true/false)

a001 something something something something
something checkbox (True/False)
a002 something something something something
something checkbox (True/False)
a003 something something something something
something checkbox (True/False)
a004 something something something something
something checkbox (True/False)
a005 something something something something
something checkbox (True/False)
etc

Thanks in advance!




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Vlookup and print loop

If you like, send, to the address below, your workbook along with very
specific details and before/after examples.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MM User" wrote in message
...
Apologies Don,

I still cannot get this working it keeps looping but even if I have an x
or k in the G column it skips?

I'm not sure if the it goes to the next row etc?

Regards,




"Don Guillett" wrote in message
...
If Len(Application.Trim(Cells(i, mc))) 0 Then
If Len(Application.Trim(Cells(i, mc).offset(0,5))) 0 Then

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MM User" wrote in message
...
Don,

I understand what you are doing (I think!) and also have the code to
print,

How do I loop my range for only the certain column

ie the vlookup refers to column A in the table to but the 'x' is in
colmun G?

I can use the to input the value :
lookuptablevalue = relevant row Column A value


sheets("sheet1").Range("A14").value = lookuptablevalue



Also the print command is

ActiveWindow.Selectedsheets.PrintOut Copies:=1, Collate:=True

Is there a way batch these altogether - not a problem if it is not
possible, just if it is.

Thanks




"Don Guillett" wrote in message
...
Why not be a bit simpler. Just put an x (or even anything) in the cell
to print

Sub printif()
mc = "k"
For i = 1 To Cells(rows.Count, mc).End(xlUp).Row
If Len(Application.Trim(Cells(i, mc))) 0 Then
'do your thing
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MM User" wrote in message
...
Hi,

I have a sheet that uses a lookup table to fill in values the sheet is
then printed.

I would like to loop the sheet so that I am able to print several
sheets if needed, I thought the best way to achieve this would be to
add a checkbox next to each record, where there is tick (true) that
record needs to be printed, - is this possible?

Sheet1 - page to be printed dropdown list located at cell a14 which
looks up the value on sheet2 column A

Sheet2 - contains the lookup table

A B C D E F G
(checkbox with link to cell - true/false)

a001 something something something something
something checkbox (True/False)
a002 something something something something
something checkbox (True/False)
a003 something something something something
something checkbox (True/False)
a004 something something something something
something checkbox (True/False)
a005 something something something something
something checkbox (True/False)
etc

Thanks in advance!



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Vlookup and print loop

Don's original code looked at column K.

If you want to look at column G, just change that "k" to "g"

Sub printif()
mc = "g" '<-- changed to g
For i = 1 To Cells(rows.Count, mc).End(xlUp).Row
If Len(Application.Trim(Cells(i, mc))) 0 Then
'do your thing
End If
Next i
End Sub

If this doesn't help, I think it's time to share the code you're using.



MM User wrote:

Apologies Don,

I still cannot get this working it keeps looping but even if I have an x or
k in the G column it skips?

I'm not sure if the it goes to the next row etc?

Regards,

"Don Guillett" wrote in message
...
If Len(Application.Trim(Cells(i, mc))) 0 Then
If Len(Application.Trim(Cells(i, mc).offset(0,5))) 0 Then

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MM User" wrote in message
...
Don,

I understand what you are doing (I think!) and also have the code to
print,

How do I loop my range for only the certain column

ie the vlookup refers to column A in the table to but the 'x' is in
colmun G?

I can use the to input the value :
lookuptablevalue = relevant row Column A value


sheets("sheet1").Range("A14").value = lookuptablevalue



Also the print command is

ActiveWindow.Selectedsheets.PrintOut Copies:=1, Collate:=True

Is there a way batch these altogether - not a problem if it is not
possible, just if it is.

Thanks




"Don Guillett" wrote in message
...
Why not be a bit simpler. Just put an x (or even anything) in the cell
to print

Sub printif()
mc = "k"
For i = 1 To Cells(rows.Count, mc).End(xlUp).Row
If Len(Application.Trim(Cells(i, mc))) 0 Then
'do your thing
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MM User" wrote in message
...
Hi,

I have a sheet that uses a lookup table to fill in values the sheet is
then printed.

I would like to loop the sheet so that I am able to print several
sheets if needed, I thought the best way to achieve this would be to
add a checkbox next to each record, where there is tick (true) that
record needs to be printed, - is this possible?

Sheet1 - page to be printed dropdown list located at cell a14 which
looks up the value on sheet2 column A

Sheet2 - contains the lookup table

A B C D E F G
(checkbox with link to cell - true/false)

a001 something something something something
something checkbox (True/False)
a002 something something something something
something checkbox (True/False)
a003 something something something something
something checkbox (True/False)
a004 something something something something
something checkbox (True/False)
a005 something something something something
something checkbox (True/False)
etc

Thanks in advance!



--

Dave Peterson
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 print loop crashes Ken Excel Programming 3 August 5th 08 08:34 PM
print preview in loop CG Rosen Excel Programming 1 June 9th 08 01:49 AM
Excel print loop [email protected] Excel Programming 3 November 22nd 06 09:49 PM
Macro for Print Loop within Excel Browner[_4_] Excel Programming 3 May 18th 06 01:22 PM
How do you Print with a loop? rohrl77 Excel Programming 3 June 14th 05 09:10 AM


All times are GMT +1. The time now is 11:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"