Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Keep a record of entries in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 515
Default Keep a record of entries in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Keep a record of entries in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 515
Default Keep a record of entries in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Keep a record of entries in cells

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!)



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Keep a record of entries in cells

I may not be understanding your need but when you DOUBLE click on a cell in
col C, that cell is copied to the next available cell in col A of the
destination sheet, the cell 8 rows down is copied to col C and the date is
inputted in B
To place the code right click on the source sheetview codecopy\paste this.
All is done from the active sheet with no selections needed or desired. If
you want more than one at a time you can use a loop.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
ar = ActiveCell.Row
With Sheets("sheet11")'Destination sheet name here
dlr = .Cells(Rows.Count, "a").End(xlUp).Row + 1
Cells(ar, "c").Copy .Cells(dlr, "a")
Cells(ar + 8, "c").Copy .Cells(dlr, "c")
..Cells(dlr, "b") = Date
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Leanne M (Aussie)" wrote in
message ...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Keep a record of entries in cells


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Keep a record of entries in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Keep a record of entries in cells

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open new record with selected fields from previous record Design by Sue Excel Discussion (Misc queries) 1 June 12th 09 02:24 PM
YTD total (6 months w/o each record having 6 entries) darkwood Excel Discussion (Misc queries) 2 August 7th 06 06:25 PM
Delete record(s) in other cells based on value of one cell. MPope Excel Discussion (Misc queries) 1 October 12th 05 06:57 PM
Record Macro - Record custom user actions Sal[_4_] Excel Programming 1 December 23rd 04 03:18 PM
record count using two different cells Josborne Excel Worksheet Functions 1 November 1st 04 09:51 PM


All times are GMT +1. The time now is 03:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"