![]() |
|
#2
|
|||
|
|||
|
Code:
Option Explicit
Sub RiteData()
Dim wkSht As Worksheet
Dim nextRow As Long
Dim lRow As Long
Dim i As Integer
Dim celltxt As String
lRow = Sheets("Main").Cells(Rows.Count, "B").End(xlUp).Row
Application.ScreenUpdating = False
For Each wkSht In Sheets
Sheets("Main").Activate
For i = 2 To lRow
celltxt = Sheets("Main").Range("B" & i)
If Sheets("Main").Range("A" & i).Value = wkSht.Name Then
Sheets("Main").Activate
wkSht.Activate
nextRow = wkSht.Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Main").Range("B" & i).Copy Destination:=wkSht.Range("A" & nextRow)
Sheets("Main").Range("B" & i) = ""
End If
Next i
Next wkSht
Sheets("Main").Activate
Sheets("Main").Range("A1").Select
Application.ScreenUpdating = True
End Sub
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Excel gives Normal.dotm: File format is not valid message (yes, Excel, not Word)
|
Windspeed | Excel | 10 | 08-03-2022 04:29 PM |
| Word & Excel 2010 - Best Options To Auto Insert MySQL & Excel Data? | Hoser | Word | 1 | 03-17-2017 03:47 PM |
How To Open an Macro From 2003 Excel in 2013 Excel Spread Sheet?
|
ADubin | Excel Programming | 3 | 02-08-2015 04:57 AM |
[Excel 2007] Building Power Point Slides from data in an Excel Table
|
bremen22 | Excel Programming | 1 | 08-07-2013 11:01 AM |
Excel 2011 can't open old Excel 98 or Excel X files
|
FLJohnson | Excel | 8 | 05-09-2012 11:26 PM |