Results 1 to 4 of 4

Thread: VBA MS Excel

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Apr:2004
    Location: MainaTown
    Posts: 160

    VBA MS Excel

    ,

    , a a .

    data.xml,

    1 2 3 4
    1 1 3 6
    2 2 33 667
    3 3 56 78

    "1" 1

    "file.xml". D data.xml B file.xml. file.xml e:



    4
    6
    667
    78

    !

  2. #2
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Mo.
    (10b) || !(10b)

  3. #3
    Registered User
    Join Date: Apr:2004
    Location: MainaTown
    Posts: 160
    Tarvin,

    , . , ..

    ontopic:

    Code:
    Sub UpdatePortfolio()
    
    Dim fName As String
    fName = Application.GetOpenFilename
    If fName = "False" Then Exit Sub
    Set wb = Workbooks.Open(fName, True, True)
    With ThisWorkbook.Worksheets("Sheet1")
    
    .Range("B1:B4").Formula = wb.Worksheets("Sheet1").Range("D1:D4").Formula
    
    End With
    wb.Close False
    Set wb = Nothing
    Application.ScreenUpdating = True
    End Sub
    , '' :
    Range("B1:B4") - , ?

  4. #4
    Registered User hateras's Avatar
    Join Date: Jan:2011
    Location: Kronos III
    Posts: 1,028
    Code:
    Sub UpdatePortfolio()
    Dim SrcWB As Workbook
    Dim SrcWS As Worksheet
    Dim DestWS As Worksheet
    
    Dim fName As String
    Dim Row As Integer
    Dim SrcCol As Integer
    Dim DestCol As Integer
    
    'Columns 'D' and 'B'
    SrcCol = 4
    DestCol = 2
    'First row to be copied
    Row = 1
    
    fName = Application.GetOpenFilename
    If fName = "False" Then Exit Sub
    
    Set SrcWB = Workbooks.Open(fName, True, True)
    Set SrcWS = SrcWB.Worksheets("Sheet1")
    Set DestWS = ThisWorkbook.Worksheets("Sheet1")
    
    While SrcWS.Cells(Row, SrcCol).Value <> ""
        DestWS.Cells(Row, DestCol).Value = SrcWS.Cells(Row, SrcCol).Value
        Row = Row + 1
    Wend
    
    SrcWB.Close False
    Set SrcWB = Nothing
    Application.ScreenUpdating = True
    End Sub
    D1 D. Cell(Row, Col).Value , Cell(Row, Col).Formula / /
    ASRock B550M Pro 4; Ryzen R5 3600; 2x16 GiB G.SKILL Aegis 3200; 1TB Samsung QVO 960 + 3TB Seagate IronWolf; Zalman Z1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |