Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-05-2014, 05:04 AM
DaZ DaZ is offline Possible Macro to read and change name whilst printing certificate Windows 7 64bit Possible Macro to read and change name whilst printing certificate Office 2013
Novice
Possible Macro to read and change name whilst printing certificate
 
Join Date: Sep 2014
Location: Staffordshire England
Posts: 5
DaZ is on a distinguished road
Default Possible Macro to read and change name whilst printing certificate

Hi All,



Hope your all well

I have been given a task of creating a certificate (which isn't the problem)

The problem I have is I need to assign a signature to it

And also I need it so that where the Name is It will read from a list of names

So when printing the certificate it will print lets say 10 certificates but the name will change on each one without me having to go through typing names it would just read from a list of names

Is this possible?

Any help would be much appreciated many thanks
Reply With Quote
  #2  
Old 09-05-2014, 12:51 PM
excelledsoftware excelledsoftware is offline Possible Macro to read and change name whilst printing certificate Windows 7 64bit Possible Macro to read and change name whilst printing certificate Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Very possible. The names would be stored in a list that would be referenced. Then we would write a loop to change the name and then print out the certificate. This would then be changed to the next name, printed etc. Could you post a sample workbook and this should be no problem.

Thanks
Reply With Quote
  #3  
Old 09-05-2014, 02:14 PM
DaZ DaZ is offline Possible Macro to read and change name whilst printing certificate Windows 7 64bit Possible Macro to read and change name whilst printing certificate Office 2010 64bit
Novice
Possible Macro to read and change name whilst printing certificate
 
Join Date: Sep 2014
Location: Staffordshire England
Posts: 5
DaZ is on a distinguished road
Default

That's great many thanks for reply

I have attached a quick layout couldn't add images etc and detail yet as 500kb limit on upload

Many thanks again
Attached Files
File Type: xlsx certificate test.xlsx (370.0 KB, 8 views)
Reply With Quote
  #4  
Old 09-05-2014, 02:54 PM
excelledsoftware excelledsoftware is offline Possible Macro to read and change name whilst printing certificate Windows 7 64bit Possible Macro to read and change name whilst printing certificate Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

No problem,

With a code that is going to automatically print out 29+ reports you will want to tap through it with F8 while you see how and if it works.

Give this a try and let us know how it works.

Code:
Option Explicit
Sub ChangeNameThenPrint()
  Dim wb As Workbook, cws As Worksheet, nws As Worksheet
  Dim CheckRow As Integer, TotalNames As Integer

  Set wb = ThisWorkbook
  Set cws = wb.Worksheets("Certificate")
  Set nws = wb.Worksheets("Names")

  TotalNames = nws.Range("A50000").End(xlUp).Row
    
  For CheckRow = 1 To TotalNames
    cws.Range("B42").Value = nws.Range("A" & CheckRow).Value
    cws.PrintOut  'You can set specific printer properties with a ( after Printout
  Next CheckRow

End Sub
Reply With Quote
  #5  
Old 09-06-2014, 09:47 AM
DaZ DaZ is offline Possible Macro to read and change name whilst printing certificate Windows 7 64bit Possible Macro to read and change name whilst printing certificate Office 2010 64bit
Novice
Possible Macro to read and change name whilst printing certificate
 
Join Date: Sep 2014
Location: Staffordshire England
Posts: 5
DaZ is on a distinguished road
Default

This worked great thank you

Just 1 more thing is it possible to list all names and add a filter so I can just filter out the names I need to print?

Thanks again much appreciated


Quote:
Originally Posted by excelledsoftware View Post
No problem,

With a code that is going to automatically print out 29+ reports you will want to tap through it with F8 while you see how and if it works.

Give this a try and let us know how it works.

Code:
Option Explicit
Sub ChangeNameThenPrint()
  Dim wb As Workbook, cws As Worksheet, nws As Worksheet
  Dim CheckRow As Integer, TotalNames As Integer

  Set wb = ThisWorkbook
  Set cws = wb.Worksheets("Certificate")
  Set nws = wb.Worksheets("Names")

  TotalNames = nws.Range("A50000").End(xlUp).Row
    
  For CheckRow = 1 To TotalNames
    cws.Range("B42").Value = nws.Range("A" & CheckRow).Value
    cws.PrintOut  'You can set specific printer properties with a ( after Printout
  Next CheckRow

End Sub
Reply With Quote
  #6  
Old 09-06-2014, 10:50 AM
excelledsoftware excelledsoftware is offline Possible Macro to read and change name whilst printing certificate Windows 7 64bit Possible Macro to read and change name whilst printing certificate Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Yup pretty easily. How about if you put a 1 or an x in column B next to the name. The code would now be this.
Code:
Option Explicit
Sub ChangeNameThenPrint()
  Dim wb As Workbook, cws As Worksheet, nws As Worksheet
  Dim CheckRow As Integer, TotalNames As Integer

  Set wb = ThisWorkbook
  Set cws = wb.Worksheets("Certificate")
  Set nws = wb.Worksheets("Names")

  TotalNames = nws.Range("A50000").End(xlUp).Row
    
  For CheckRow = 1 To TotalNames
    If nws.Range("B" & CheckRow).Value <> "" Then
      cws.Range("B42").Value = nws.Range("A" & CheckRow).Value
      cws.PrintOut  'You can set specific printer properties with a ( after Printout
    End If
  Next CheckRow

End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing a notebook whilst restricting pages Tom1 OneNote 1 08-12-2014 04:27 AM
Email macro to read range for .To field MattMurdock Excel Programming 2 08-07-2012 06:46 AM
Possible Macro to read and change name whilst printing certificate Macro to read word document harishankar.selvaraju Excel Programming 1 06-14-2012 03:48 AM
Bold numerals whilst typing normally! ianl1532 Word 2 02-20-2012 10:20 PM
Possible Macro to read and change name whilst printing certificate Change personal folder items to 'read" J C M Outlook 1 01-09-2012 10:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft