דילוג לתוכן
  • דף הבית
  • קטגוריות
  • פוסטים אחרונים
  • משתמשים
  • חיפוש
  • חוקי הפורום
כיווץ
תחומים

תחומים - פורום חרדי מקצועי

💡 רוצה לזכור קריאת שמע בזמן? לחץ כאן!
  1. דף הבית
  2. תכנות
  3. בקשת עזרה בקוד מאקרו

בקשת עזרה בקוד מאקרו

מתוזמן נעוץ נעול הועבר תכנות
1 פוסטים 1 כותבים 82 צפיות
  • מהישן לחדש
  • מהחדש לישן
  • הכי הרבה הצבעות
התחברו כדי לפרסם תגובה
נושא זה נמחק. רק משתמשים עם הרשאות מתאימות יוכלו לצפות בו.
  • pcinfogmachP מנותק
    pcinfogmachP מנותק
    pcinfogmach
    כתב ב נערך לאחרונה על ידי dovid
    #1

    י שלי קוד שאמור להסיר מספור עמודים מעמודים מסויימין בלבד.
    כדי לעשות זאת צריך להוסיף מעבר מקטע לפני ואחרי העמודים הרצויים. ואז להסיר את הקישור למקטע הקודם מהמקטע החדש שנוצר - וגם להסיר את הקישור מהמקטע שאחריו (כדי שמיספור יעבוד גם אחריו) ואז למחוק את המיספור עמודים.
    הקוד שלי עובד כשעוברים עליו שורה שורה (על ידי f8) אבל כשמריצים אותו ברצף הוא מוחק את הכותרת התחתית של המקטע שלפני המקטע הרצוי.

    Sub SelectPages()
        
    
    Dim allPages As Range, firstPage As Range, lastPage As Range, iPage As Long, xPage As Long
    
    Set allPages = Selection.Range
    Set firstPage = Selection.Range
    Set lastPage = Selection.Range
    
    firstPage.Collapse Direction:=wdCollapseStart
    lastPage.Collapse Direction:=wdCollapseEnd
    
    iPage = firstPage.Information(wdActiveEndPageNumber)
    xPage = lastPage.Information(wdActiveEndPageNumber)
        
    With ActiveDocument
    
      Set firstPage = .GoTo(What:=wdGoToPage, Name:=iPage)
      Set firstPage = firstPage.GoTo(What:=wdGoToBookmark, Name:="\page")
      
      firstPage.Collapse Direction:=wdCollapseStart
      firstPage.InsertBreak Type:=wdSectionBreakNextPage
        
       Set lastPage = .GoTo(What:=wdGoToPage, Name:=xPage)
       Set lastPage = lastPage.GoTo(What:=wdGoToBookmark, Name:="\page")
       
       lastPage.Collapse Direction:=wdCollapseEnd
       lastPage.InsertBreak Type:=wdSectionBreakNextPage
    
    End With
    
    
    lastPage.Select
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
     Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter. _
            LinkToPrevious
    lastPage.Select
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
     Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter. _
            LinkToPrevious
    
    firstPage.Select
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
     Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter. _
            LinkToPrevious
    firstPage.Select
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.Delete
    
    firstPage.Select
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
     Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter. _
            LinkToPrevious
    Selection.Delete
    firstPage.Select
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
    Selection.Delete
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
        
    End Sub
    

    גמ"ח מידע מחשבים ואופיס

    תגובה 1 תגובה אחרונה
    0

    בא תתחבר לדף היומי!
    • התחברות

    • אין לך חשבון עדיין? הרשמה

    • התחברו או הירשמו כדי לחפש.
    • פוסט ראשון
      פוסט אחרון
    0
    • דף הבית
    • קטגוריות
    • פוסטים אחרונים
    • משתמשים
    • חיפוש
    • חוקי הפורום