Hi I try to make a sheet like the example was posted a few weeks ago, to input data in a form and store it in another tab, https://www.teachexcel.com/excel-tutorial/input-form-to-get-data-and-store-it-in-another-tab-in-excel_1570.html?nav=email, but I want to do it with a range of cells, let's say the input is in sheet1 in cells B2:B20, and I want to store it in another tab, but I can't figure out how to make it, can someone help me please?
thank you
Option Explicit
Sub test()
Dim ws_input As String
Dim ws_timein As String
Dim ws_timeout As String
Dim ws_missing As String
Dim next_column As Integer
'This is the shhet names
ws_input = "Input"
ws_timein = "Time In"
ws_timeout = "Time Out"
ws_missing = "Missing"
next_column = Sheets(ws_timein).Cells(1, Columns.Count).End(xlToLeft).Offset(, 1).Column 'this line find out what the next empty column
Sheets(ws_timein).Cells(1, next_column).Value = Range("date").Value '"date" is a Name Manager for the date cell
Sheets(ws_timein).Cells(2, next_column).Value = Range("time_in").Value '"time_in" is a Name Manager for column B
next_column = Sheets(ws_timeout).Cells(1, Columns.Count).End(xlToLeft).Offset(, 1).Column
Sheets(ws_timeout).Cells(1, next_column).Value = Range("date").Value
Sheets(ws_timeout).Cells(2, next_column).Value = Range("time_out").Value '"time_out" is a Name Manager for column C
next_column = Sheets(ws_missing).Cells(1, Columns.Count).End(xlToLeft).Offset(, 1).Column
Sheets(ws_missing).Cells(1, next_column).Value = Range("date").Value
Sheets(ws_missing).Cells(2, next_column).Value = Range("missing").Value '"missing" is a Name Manager for column D
'This lines clears the date cell and the ranges to be ready for the new data
Range("date").ClearContents
Range("time_in").ClearContents
Sheets(ws_input).Range("B2").Value = "Time In" 'this line set the title for column B
Range("date").ClearContents
Range("time_out").ClearContents
Sheets(ws_input).Range("C2").Value = "Time Out"
Range("date").ClearContents
Range("missing").ClearContents
Sheets(ws_input).Range("D2").Value = "Missing"
End Sub
instead to make --Cells(2, next_column) -- what gives me only 1 cell I need a range of 20 cells
,