Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Envoke code with button rather than as data is entered.

I'm using this code to populate the WS "Summary" if any of the other
worksheets in the WB have data in Col A and B. As col A and B have text
entered into them, it also goes to the Summary WS in Col A and B respectively
with the source WS name in Col C. I would like to alter this code to have
it launch with a button rather than when data is entered into the worksheets.
Any suggestions on how to do this? Also I need the summary WS to populate
in columns B, C and D instead of A, B and C since I now have the row numbers
in col A. Thanks again.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If IsEmpty(Target.Value) Then Exit Sub
If Target.Column = 2 Then
Application.Screenupdating = False
With Sheets("Summary")
Target.Offset(, -1).Resize(, 2).Copy
..Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial
..Range("C" & Rows.Count).End(xlUp).Offset(1).Value = Me.Name
End With
Application.Screenupdating = True
End If

End Sub

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
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Can I envoke change tracking on a password protected excel file? Marisa Excel Worksheet Functions 0 November 17th 06 03:21 AM
Store data JUST entered in Activecell after clicking command button on worksheet [email protected] Excel Programming 1 August 23rd 06 04:20 AM
Using automatically entered code Tim[_44_] Excel Programming 4 September 7th 05 06:05 PM
Command Button Code to copy data sho Excel Programming 3 July 7th 04 01:53 PM


All times are GMT +1. The time now is 02:21 PM.

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"