LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copying worksheet A values into worksheet B - missing cell values

Hi,

I am trying to copy column values from the worksheet entitled "Stage
Forecast" to another worksheet called "Training Dashboard". I have written up
most of the code however during the transfer, not all the data is copying
over. As you can see from the code, I am mainly concerned with data that is
found in column J of the "Training Dashboard" worksheet. If column Y of
"Stage Forecast" has any cells that are empty, I do not display its row.

Also within column Y of "Stage Forecast", it is a date field that is either
shown underlined, or crossed out (meaning completed). I am only receiving
data that is crossed out using this code. I need to alter what is shown below
so that the data that is transmitted is only those rows in which row Y has a
date that is simply underlined.

Secondly as a secondary piece of code: I need my second worksheet "Training
Dashboard" to not show duplicate information once I click the the command
button to update the sheet.

Any help would be greaty appreciated,

Thanks.

VB code:

Sub CommandButton1_Click()
Dim WS1 As Worksheet, WS2 As Worksheet
Dim myrange, MyRange1 As Range
Application.ScreenUpdating = False

Set WS1 = Worksheets("Stage Forecast")
Set WS2 = Worksheets("Training Dashboard")

WS1.Range("K1:K330").Copy WS2.Cells(Rows.Count, "D").End(xlUp)
WS1.Range("L1:L330").Copy WS2.Cells(Rows.Count, "E").End(xlUp)
WS1.Range("M1:M330").Copy WS2.Cells(Rows.Count, "F").End(xlUp)
WS1.Range("N1:N330").Copy WS2.Cells(Rows.Count, "G").End(xlUp)
WS1.Range("O1:O330").Copy WS2.Cells(Rows.Count, "H").End(xlUp)
WS1.Range("Q1:Q330").Copy WS2.Cells(Rows.Count, "I").End(xlUp)
WS1.Range("Y1:Y330").Copy WS2.Cells(Rows.Count, "J").End(xlUp)

LastRow = Cells(Rows.Count, "J").End(xlUp).Row
Set myrange = Sheets("Training Dashboard").Range("J3:J" & LastRow)
For Each c In myrange
If UCase(c.Value) = "" Then
If MyRange1 Is Nothing Then
Set MyRange1 = c.EntireRow
Else
Set MyRange1 = Union(MyRange1, c.EntireRow)
End If
End If
Next
If Not MyRange1 Is Nothing Then
MyRange1.Delete
End If

End Sub

 
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
Copy Values from WorkSheet back to Another Workbook Replacing Values in Worksheet bobwilson[_16_] Excel Programming 0 April 3rd 06 09:50 PM
copying an entire worksheet - need absolute values Cowtoon Excel Worksheet Functions 1 December 12th 05 10:08 PM
Copying values and formatting but not formulae to new worksheet with VBA [email protected] Excel Programming 3 October 28th 05 02:27 PM
Hided values appears when I'm copying/pasting it to other worksheet Aivaras_Bakanas Excel Discussion (Misc queries) 2 July 13th 05 02:18 PM
(Newbie) Copying values from an array to the worksheet Srdjan Kovacevic[_5_] Excel Programming 1 July 12th 05 03:47 PM


All times are GMT +1. The time now is 06:53 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"