PC Review


Reply
Thread Tools Rate Thread

Copy function down column in vba

 
 
Jennifer
Guest
Posts: n/a
 
      20th Feb 2008
Hi there,
I am using the following code when the user hits the enter button on a form.
As you can see values from the various txt boxes, cbo boxes etc. are put into
the 1st blank row at the bottom of the database. What i need now is to know
how to copy the formula in column 7 from the row above, down to be even with
all the data that was just entered. Hope this is clear.

Private Sub cmdAdd_Click()
ActiveWorkbook.Sheets("Sheet3").Activate
'stops flickering
Application.ScreenUpdating = False
Set ws = Worksheets("Database")
iRow = ws.Cells(Rows.Count, 2).End(xlUp).Row + 1
ws.Cells(iRow, 1).Value = "N/A"
ws.Cells(iRow, 6).Value = Me.Calendar1
ws.Cells(iRow, 4).Value = Me.txtPounds.Value
ws.Cells(iRow, 2).Value = Me.cboIngredient.Value
ws.Cells(iRow, 5).Value = "Actual"
ws.Cells(iRow, 7).value = ?????????????
Me.ListBox1.Value = Update

--
Thank you,

Jennifer
 
Reply With Quote
 
 
 
 
Gary Keramidas
Guest
Posts: n/a
 
      20th Feb 2008
i'm no sure what you're trying to do

maybe

ws.Cells(irow - 1, 7).Copy
ws.Cells(irow, 7).PasteSpecial xlPasteFormulas

--

Gary


"Jennifer" <(E-Mail Removed)> wrote in message
news:FA2C13DA-F6A9-461A-98C3-(E-Mail Removed)...
> Hi there,
> I am using the following code when the user hits the enter button on a
> form.
> As you can see values from the various txt boxes, cbo boxes etc. are put
> into
> the 1st blank row at the bottom of the database. What i need now is to
> know
> how to copy the formula in column 7 from the row above, down to be even
> with
> all the data that was just entered. Hope this is clear.
>
> Private Sub cmdAdd_Click()
> ActiveWorkbook.Sheets("Sheet3").Activate
> 'stops flickering
> Application.ScreenUpdating = False
> Set ws = Worksheets("Database")
> iRow = ws.Cells(Rows.Count, 2).End(xlUp).Row + 1
> ws.Cells(iRow, 1).Value = "N/A"
> ws.Cells(iRow, 6).Value = Me.Calendar1
> ws.Cells(iRow, 4).Value = Me.txtPounds.Value
> ws.Cells(iRow, 2).Value = Me.cboIngredient.Value
> ws.Cells(iRow, 5).Value = "Actual"
> ws.Cells(iRow, 7).value = ?????????????
> Me.ListBox1.Value = Update
>
> --
> Thank you,
>
> Jennifer


 
Reply With Quote
 
Jennifer
Guest
Posts: n/a
 
      20th Feb 2008
Ya that worked - - brain fart there. Thanks pretty easy!
How do you get the highlighted copied area to stop flashing on the
worksheet? I always have this problem when I try and copy formulas in VBA
into a worksheet. Thanks again. Jennifer
--
Thank you,

Jennifer


"Gary Keramidas" wrote:

> i'm no sure what you're trying to do
>
> maybe
>
> ws.Cells(irow - 1, 7).Copy
> ws.Cells(irow, 7).PasteSpecial xlPasteFormulas
>
> --
>
> Gary
>
>
> "Jennifer" <(E-Mail Removed)> wrote in message
> news:FA2C13DA-F6A9-461A-98C3-(E-Mail Removed)...
> > Hi there,
> > I am using the following code when the user hits the enter button on a
> > form.
> > As you can see values from the various txt boxes, cbo boxes etc. are put
> > into
> > the 1st blank row at the bottom of the database. What i need now is to
> > know
> > how to copy the formula in column 7 from the row above, down to be even
> > with
> > all the data that was just entered. Hope this is clear.
> >
> > Private Sub cmdAdd_Click()
> > ActiveWorkbook.Sheets("Sheet3").Activate
> > 'stops flickering
> > Application.ScreenUpdating = False
> > Set ws = Worksheets("Database")
> > iRow = ws.Cells(Rows.Count, 2).End(xlUp).Row + 1
> > ws.Cells(iRow, 1).Value = "N/A"
> > ws.Cells(iRow, 6).Value = Me.Calendar1
> > ws.Cells(iRow, 4).Value = Me.txtPounds.Value
> > ws.Cells(iRow, 2).Value = Me.cboIngredient.Value
> > ws.Cells(iRow, 5).Value = "Actual"
> > ws.Cells(iRow, 7).value = ?????????????
> > Me.ListBox1.Value = Update
> >
> > --
> > Thank you,
> >
> > Jennifer

>
>

 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      20th Feb 2008
application.CutCopyMode = false

should do it

--

Gary


"Jennifer" <(E-Mail Removed)> wrote in message
news:27050331-D42B-4668-8099-(E-Mail Removed)...
> Ya that worked - - brain fart there. Thanks pretty easy!
> How do you get the highlighted copied area to stop flashing on the
> worksheet? I always have this problem when I try and copy formulas in VBA
> into a worksheet. Thanks again. Jennifer
> --
> Thank you,
>
> Jennifer
>
>
> "Gary Keramidas" wrote:
>
>> i'm no sure what you're trying to do
>>
>> maybe
>>
>> ws.Cells(irow - 1, 7).Copy
>> ws.Cells(irow, 7).PasteSpecial xlPasteFormulas
>>
>> --
>>
>> Gary
>>
>>
>> "Jennifer" <(E-Mail Removed)> wrote in message
>> news:FA2C13DA-F6A9-461A-98C3-(E-Mail Removed)...
>> > Hi there,
>> > I am using the following code when the user hits the enter button on a
>> > form.
>> > As you can see values from the various txt boxes, cbo boxes etc. are
>> > put
>> > into
>> > the 1st blank row at the bottom of the database. What i need now is to
>> > know
>> > how to copy the formula in column 7 from the row above, down to be even
>> > with
>> > all the data that was just entered. Hope this is clear.
>> >
>> > Private Sub cmdAdd_Click()
>> > ActiveWorkbook.Sheets("Sheet3").Activate
>> > 'stops flickering
>> > Application.ScreenUpdating = False
>> > Set ws = Worksheets("Database")
>> > iRow = ws.Cells(Rows.Count, 2).End(xlUp).Row + 1
>> > ws.Cells(iRow, 1).Value = "N/A"
>> > ws.Cells(iRow, 6).Value = Me.Calendar1
>> > ws.Cells(iRow, 4).Value = Me.txtPounds.Value
>> > ws.Cells(iRow, 2).Value = Me.cboIngredient.Value
>> > ws.Cells(iRow, 5).Value = "Actual"
>> > ws.Cells(iRow, 7).value = ?????????????
>> > Me.ListBox1.Value = Update
>> >
>> > --
>> > Thank you,
>> >
>> > Jennifer

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy one column values to another column based on conditionthat row2 contain todays date sanju Microsoft Excel Programming 4 16th Apr 2010 02:26 AM
Indirect function – relative column copy/paste Gary T Microsoft Excel Worksheet Functions 1 24th Sep 2008 02:52 PM
How do I copy a data from a single column into an array and back into another column? wgoulet@gmail.com Microsoft Excel Programming 1 10th Feb 2007 05:03 AM
RE: Find specific column titles and copy the column to new workboo =?Utf-8?B?SkxHV2hpeg==?= Microsoft Excel Programming 0 11th Dec 2006 11:23 PM
copy a function to a whole column =?Utf-8?B?Y2hlbHNlYWZjMTk2OTIwMDZhbmRvbg==?= Microsoft Excel Setup 1 14th Jun 2006 09:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:20 AM.