Results 1 to 4 of 4
Thread: VBA MS Excel
Hybrid View
-
1st March 2015 12:37 #1Registered 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
!
-
1st March 2015 21:56 #2Mire-x
Join Date: Apr:2005
Location: Sofia
Posts: 763
Mo.
(10b) || !(10b)
-
2nd March 2015 10:58 #3Registered 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") - , ?
-
2nd March 2015 13:17 #4D1 D. Cell(Row, Col).Value , Cell(Row, Col).Formula / /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 SubASRock B550M Pro 4; Ryzen R5 3600; 2x16 GiB G.SKILL Aegis 3200; 1TB Samsung QVO 960 + 3TB Seagate IronWolf; Zalman Z1




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in