Good day. Please tell me how in VBA to read data from cells of one sheet and insert them into cells of another sheet? Variants with formulas do not offer, because it is required through VBA
2 answers
Sub switch() Dim wb As Workbook Dim ws1, ws2 As Worksheet Set wb = Application.ActiveWorkbook Set ws1 = wb.Worksheets("Лист1") Set ws2 = wb.Worksheets("Лист2") ' индексация ячеек начинается с 1 в формате (номер строки, номер столбца) ' скопирует данные с первого листа ячейки A1 на второй лист в ячейку A1 ws2.Cells(1, 1) = ws1.Cells(1, 1) End Sub
|
Sheets("Sheet2").Range("A1").Value = Sheets("Sheet1").Range("A1").Value
- Try to write more detailed answers. Explain what is the basis of your statement? - Nicolas Chabanovsky ♦
- Please specify: what event to read? Enough buttons to run a macro? Copy range or cell? If large ranges, with permutation or sampling, it is better to use arrays: read the original data into memory, process, unload on the sheet. - vikttur
|