Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
What I am trying to do is when a button is clicked I want the information to be recorded. I have just used a basic macro to copy and paste and to enter the date but it does not work. I think I may need to use more complicated coding and in this case HELP!!!!!!!!!!!!!!!!!!!!! This is what I have used for the first part of the process - Private Sub CommandButton1_Click() Range("C6").Select Selection.Copy Sheets("Sheet3").Select Range("A3").Select ActiveSheet.Paste Range("B3").Select Sheets("Sheet1").Select Range("C14").Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet3").Select Range("C3").Select ActiveSheet.Paste Range("B3").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=TODAY()" Range("B4").Select Sheets("Sheet1").Select End Sub Here is what I want to do - (at this stage) Click button Confirm Have details from C6 & C14 recorded somewhere (currently a new sheet but not important) and date stamped. This will allow me to keep a record of stock taken. Thanks in advance -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Although cumbersome code, it works?
You can reduce it to the following: Dim wS1, wS2 as Worksheet Private sub Test() Set wS1 as = Worksheets("Sheet1") Set wS2 = Worksheets("Sheet3") wS1.Range("C6").Copy wS2.Range("A3") wS1.Range("C14").Copy wS2.Range("C3") wS2.Range("B3") = "=TODAY()" wS1.Activate End Sub -- Hth Kassie Kasselman Change xxx to hotmail "Leanne M (Aussie)" wrote: Hi, What I am trying to do is when a button is clicked I want the information to be recorded. I have just used a basic macro to copy and paste and to enter the date but it does not work. I think I may need to use more complicated coding and in this case HELP!!!!!!!!!!!!!!!!!!!!! This is what I have used for the first part of the process - Private Sub CommandButton1_Click() Range("C6").Select Selection.Copy Sheets("Sheet3").Select Range("A3").Select ActiveSheet.Paste Range("B3").Select Sheets("Sheet1").Select Range("C14").Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet3").Select Range("C3").Select ActiveSheet.Paste Range("B3").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=TODAY()" Range("B4").Select Sheets("Sheet1").Select End Sub Here is what I want to do - (at this stage) Click button Confirm Have details from C6 & C14 recorded somewhere (currently a new sheet but not important) and date stamped. This will allow me to keep a record of stock taken. Thanks in advance -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you this works.
How do I now get it to go to the next blank row so that I can continue to record the data? Leanne -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) "Kassie" wrote: Although cumbersome code, it works? You can reduce it to the following: Dim wS1, wS2 as Worksheet Private sub Test() Set wS1 as = Worksheets("Sheet1") Set wS2 = Worksheets("Sheet3") wS1.Range("C6").Copy wS2.Range("A3") wS1.Range("C14").Copy wS2.Range("C3") wS2.Range("B3") = "=TODAY()" wS1.Activate End Sub -- Hth Kassie Kasselman Change xxx to hotmail "Leanne M (Aussie)" wrote: Hi, What I am trying to do is when a button is clicked I want the information to be recorded. I have just used a basic macro to copy and paste and to enter the date but it does not work. I think I may need to use more complicated coding and in this case HELP!!!!!!!!!!!!!!!!!!!!! This is what I have used for the first part of the process - Private Sub CommandButton1_Click() Range("C6").Select Selection.Copy Sheets("Sheet3").Select Range("A3").Select ActiveSheet.Paste Range("B3").Select Sheets("Sheet1").Select Range("C14").Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet3").Select Range("C3").Select ActiveSheet.Paste Range("B3").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=TODAY()" Range("B4").Select Sheets("Sheet1").Select End Sub Here is what I want to do - (at this stage) Click button Confirm Have details from C6 & C14 recorded somewhere (currently a new sheet but not important) and date stamped. This will allow me to keep a record of stock taken. Thanks in advance -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would require a lot more info to assist you further! In your example, you
copied from C6 and C14. Where would the next pair be situated - C7 and C15, or D6 and D14, or what? How many lines do you want to copy, or is this variable? Aussies go to the UK, S Africans to Aus, and so it goes on! -- Hth Kassie Kasselman Change xxx to hotmail "Leanne M (Aussie)" wrote: Thank you this works. How do I now get it to go to the next blank row so that I can continue to record the data? Leanne -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) "Kassie" wrote: Although cumbersome code, it works? You can reduce it to the following: Dim wS1, wS2 as Worksheet Private sub Test() Set wS1 as = Worksheets("Sheet1") Set wS2 = Worksheets("Sheet3") wS1.Range("C6").Copy wS2.Range("A3") wS1.Range("C14").Copy wS2.Range("C3") wS2.Range("B3") = "=TODAY()" wS1.Activate End Sub -- Hth Kassie Kasselman Change xxx to hotmail "Leanne M (Aussie)" wrote: Hi, What I am trying to do is when a button is clicked I want the information to be recorded. I have just used a basic macro to copy and paste and to enter the date but it does not work. I think I may need to use more complicated coding and in this case HELP!!!!!!!!!!!!!!!!!!!!! This is what I have used for the first part of the process - Private Sub CommandButton1_Click() Range("C6").Select Selection.Copy Sheets("Sheet3").Select Range("A3").Select ActiveSheet.Paste Range("B3").Select Sheets("Sheet1").Select Range("C14").Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet3").Select Range("C3").Select ActiveSheet.Paste Range("B3").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=TODAY()" Range("B4").Select Sheets("Sheet1").Select End Sub Here is what I want to do - (at this stage) Click button Confirm Have details from C6 & C14 recorded somewhere (currently a new sheet but not important) and date stamped. This will allow me to keep a record of stock taken. Thanks in advance -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Kassie,
the next pair would be copied from the same location but they would need to be copied to A4 & C4. The number of times I need to do this is variable. The location they are copied from is kind of a template so would be changed each time. Hope this makes sense. Leanne -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) "Kassie" wrote: I would require a lot more info to assist you further! In your example, you copied from C6 and C14. Where would the next pair be situated - C7 and C15, or D6 and D14, or what? How many lines do you want to copy, or is this variable? Aussies go to the UK, S Africans to Aus, and so it goes on! -- Hth Kassie Kasselman Change xxx to hotmail "Leanne M (Aussie)" wrote: Thank you this works. How do I now get it to go to the next blank row so that I can continue to record the data? Leanne -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) "Kassie" wrote: Although cumbersome code, it works? You can reduce it to the following: Dim wS1, wS2 as Worksheet Private sub Test() Set wS1 as = Worksheets("Sheet1") Set wS2 = Worksheets("Sheet3") wS1.Range("C6").Copy wS2.Range("A3") wS1.Range("C14").Copy wS2.Range("C3") wS2.Range("B3") = "=TODAY()" wS1.Activate End Sub -- Hth Kassie Kasselman Change xxx to hotmail "Leanne M (Aussie)" wrote: Hi, What I am trying to do is when a button is clicked I want the information to be recorded. I have just used a basic macro to copy and paste and to enter the date but it does not work. I think I may need to use more complicated coding and in this case HELP!!!!!!!!!!!!!!!!!!!!! This is what I have used for the first part of the process - Private Sub CommandButton1_Click() Range("C6").Select Selection.Copy Sheets("Sheet3").Select Range("A3").Select ActiveSheet.Paste Range("B3").Select Sheets("Sheet1").Select Range("C14").Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet3").Select Range("C3").Select ActiveSheet.Paste Range("B3").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=TODAY()" Range("B4").Select Sheets("Sheet1").Select End Sub Here is what I want to do - (at this stage) Click button Confirm Have details from C6 & C14 recorded somewhere (currently a new sheet but not important) and date stamped. This will allow me to keep a record of stock taken. Thanks in advance -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() wS2.Range("B3") = "=TODAY()" inserts the TODAY function, it'll be updated each day. A time stamp must remain unchanged! Use wS2.Range("B3") = Date Regards, Stefi €˛Kassie€¯ ezt Ć*rta: Although cumbersome code, it works? You can reduce it to the following: Dim wS1, wS2 as Worksheet Private sub Test() Set wS1 as = Worksheets("Sheet1") Set wS2 = Worksheets("Sheet3") wS1.Range("C6").Copy wS2.Range("A3") wS1.Range("C14").Copy wS2.Range("C3") wS2.Range("B3") = "=TODAY()" wS1.Activate End Sub -- Hth Kassie Kasselman Change xxx to hotmail "Leanne M (Aussie)" wrote: Hi, What I am trying to do is when a button is clicked I want the information to be recorded. I have just used a basic macro to copy and paste and to enter the date but it does not work. I think I may need to use more complicated coding and in this case HELP!!!!!!!!!!!!!!!!!!!!! This is what I have used for the first part of the process - Private Sub CommandButton1_Click() Range("C6").Select Selection.Copy Sheets("Sheet3").Select Range("A3").Select ActiveSheet.Paste Range("B3").Select Sheets("Sheet1").Select Range("C14").Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet3").Select Range("C3").Select ActiveSheet.Paste Range("B3").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=TODAY()" Range("B4").Select Sheets("Sheet1").Select End Sub Here is what I want to do - (at this stage) Click button Confirm Have details from C6 & C14 recorded somewhere (currently a new sheet but not important) and date stamped. This will allow me to keep a record of stock taken. Thanks in advance -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Stefi
-- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) "Stefi" wrote: wS2.Range("B3") = "=TODAY()" inserts the TODAY function, it'll be updated each day. A time stamp must remain unchanged! Use wS2.Range("B3") = Date Regards, Stefi €˛Kassie€¯ ezt Ć*rta: Although cumbersome code, it works? You can reduce it to the following: Dim wS1, wS2 as Worksheet Private sub Test() Set wS1 as = Worksheets("Sheet1") Set wS2 = Worksheets("Sheet3") wS1.Range("C6").Copy wS2.Range("A3") wS1.Range("C14").Copy wS2.Range("C3") wS2.Range("B3") = "=TODAY()" wS1.Activate End Sub -- Hth Kassie Kasselman Change xxx to hotmail "Leanne M (Aussie)" wrote: Hi, What I am trying to do is when a button is clicked I want the information to be recorded. I have just used a basic macro to copy and paste and to enter the date but it does not work. I think I may need to use more complicated coding and in this case HELP!!!!!!!!!!!!!!!!!!!!! This is what I have used for the first part of the process - Private Sub CommandButton1_Click() Range("C6").Select Selection.Copy Sheets("Sheet3").Select Range("A3").Select ActiveSheet.Paste Range("B3").Select Sheets("Sheet1").Select Range("C14").Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet3").Select Range("C3").Select ActiveSheet.Paste Range("B3").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=TODAY()" Range("B4").Select Sheets("Sheet1").Select End Sub Here is what I want to do - (at this stage) Click button Confirm Have details from C6 & C14 recorded somewhere (currently a new sheet but not important) and date stamped. This will allow me to keep a record of stock taken. Thanks in advance -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are welcome! Thanks for the feedback!
Stefi €˛Leanne M (Aussie)€¯ ezt Ć*rta: Thank you Stefi -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) "Stefi" wrote: wS2.Range("B3") = "=TODAY()" inserts the TODAY function, it'll be updated each day. A time stamp must remain unchanged! Use wS2.Range("B3") = Date Regards, Stefi €˛Kassie€¯ ezt Ć*rta: Although cumbersome code, it works? You can reduce it to the following: Dim wS1, wS2 as Worksheet Private sub Test() Set wS1 as = Worksheets("Sheet1") Set wS2 = Worksheets("Sheet3") wS1.Range("C6").Copy wS2.Range("A3") wS1.Range("C14").Copy wS2.Range("C3") wS2.Range("B3") = "=TODAY()" wS1.Activate End Sub -- Hth Kassie Kasselman Change xxx to hotmail "Leanne M (Aussie)" wrote: Hi, What I am trying to do is when a button is clicked I want the information to be recorded. I have just used a basic macro to copy and paste and to enter the date but it does not work. I think I may need to use more complicated coding and in this case HELP!!!!!!!!!!!!!!!!!!!!! This is what I have used for the first part of the process - Private Sub CommandButton1_Click() Range("C6").Select Selection.Copy Sheets("Sheet3").Select Range("A3").Select ActiveSheet.Paste Range("B3").Select Sheets("Sheet1").Select Range("C14").Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet3").Select Range("C3").Select ActiveSheet.Paste Range("B3").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=TODAY()" Range("B4").Select Sheets("Sheet1").Select End Sub Here is what I want to do - (at this stage) Click button Confirm Have details from C6 & C14 recorded somewhere (currently a new sheet but not important) and date stamped. This will allow me to keep a record of stock taken. Thanks in advance -- Leanne M (Aussie) (Changed Display name from Leanne) United Kingdom (Don''t ask me what an Aussie is doing living in the UK!) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open new record with selected fields from previous record | Excel Discussion (Misc queries) | |||
YTD total (6 months w/o each record having 6 entries) | Excel Discussion (Misc queries) | |||
Delete record(s) in other cells based on value of one cell. | Excel Discussion (Misc queries) | |||
Record Macro - Record custom user actions | Excel Programming | |||
record count using two different cells | Excel Worksheet Functions |