muhammad susanto
Well-known Member
- Joined
- Jan 8, 2013
- Messages
- 2,102
- Office Version
- 365
- 2021
- Platform
- Windows
hi all.
i found vba code to import data from another , this code below work properly
unfortunally, data that success imported still contains formula .
i want to how to code work with result ..like Paste Value not included formula
sorry:
in "destination sheet" i don't use AutoFit Column....
i want to remove auto fit column
someone help me, great appreciated
.sst
i found vba code to import data from another , this code below work properly
unfortunally, data that success imported still contains formula .
i want to how to code work with result ..like Paste Value not included formula
VBA Code:
Sub ImportDatafromotherworksheet()
Dim wkbCrntWorkBook As Workbook
Dim wkbSourceBook As Workbook
Dim rngSourceRange As Range
Dim rngDestination As Range
Set wkbCrntWorkBook = ActiveWorkbook
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Excel 2007-13", "*.xlsx; *.xlsm; *.xls"
.AllowMultiSelect = False
.Show
If .SelectedItems.Count > 0 Then
Workbooks.Open .SelectedItems(1)
Set wkbSourceBook = ActiveWorkbook
Set rngSourceRange = Application.InputBox(prompt:="Select source range", Title:="Source Range", Default:="A1", Type:=8)
wkbCrntWorkBook.Activate
Set rngDestination = Application.InputBox(prompt:="Select destination cell", Title:="Select Destination", Default:="A1", Type:=8)
rngSourceRange.Copy rngDestination
rngDestination.CurrentRegion.EntireColumn.AutoFit
wkbSourceBook.Close False
End If
End With
End Sub
in "destination sheet" i don't use AutoFit Column....
i want to remove auto fit column
someone help me, great appreciated
.sst
Last edited: