درخواست داینامیک کردن آدرس

Collapse
X
 
  • زمان
  • نمایش
حذف همه
new posts
  • alisabet

    • 2011/09/08
    • 159
    • 45.00

    درخواست داینامیک کردن آدرس

    با سلام حضور اساتید گرامی و کاربران محترم انجمن

    خواهش میکنم راهنمائی بفرمائید شکل داینامیک این کد چگونه است
    کد PHP:
    Sheets("Sheet1").scrollarea="A1:J100" 
    منظورم اینست که اگر مثلاً شماره ستون متغیر بود یا ردیف متغیر بود شکل کد چگونه میشود
  • iranweld

    • 2015/03/29
    • 3341

    #2
    نوشته اصلی توسط alisabet
    با سلام حضور اساتید گرامی و کاربران محترم انجمن

    خواهش میکنم راهنمائی بفرمائید شکل داینامیک این کد چگونه است
    کد PHP:
    Sheets("Sheet1").scrollarea="A1:J100" 
    منظورم اینست که اگر مثلاً شماره ستون متغیر بود یا ردیف متغیر بود شکل کد چگونه میشود
    با سلام
    این کد را امتحان کنید
    کد PHP:
                     Me.ScrollArea Range(Cells(11), Cells(LastRowLastColumn)).Address 
    کد PHP:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    Dim LastColumn As Integer

    Dim LastRow 
    As Long



            
    If WorksheetFunction.CountA(Cells) > 0 Then

        

            
    'Search for any entry, by searching backwards by Rows.

            LastRow = Cells.Find(What:="*", After:=[A1], _

                        SearchOrder:=xlByRows, _

                        SearchDirection:=xlPrevious).Row

             If LastRow <> 65536 Then LastRow = LastRow + 1

             

            '
    Search for any entryby searching backwards by Columns.

                    
    LastColumn Cells.Find(What:="*"After:=[A1], _

                        SearchOrder
    :=xlByColumns_

                        SearchDirection
    :=xlPrevious).Column

                     
    If LastColumn <> 256 Then LastColumn LastColumn 1

                     

                     Me
    .ScrollArea Range(Cells(11), Cells(LastRowLastColumn)).Address

        
    Else

                     
    Me.ScrollArea ""

        
    End If

     
    End Sub 

    کامنت

    • alisabet

      • 2011/09/08
      • 159
      • 45.00

      #3
      نوشته اصلی توسط iranweld
      با سلام
      این کد را امتحان کنید
      کد PHP:
                       Me.ScrollArea Range(Cells(11), Cells(LastRowLastColumn)).Address
         
       End Sub 
      با تشکر ، جواب داد

      کامنت

      چند لحظه..