Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 05-17-2015, 12:04 AM
excelledsoftware excelledsoftware is offline A challenging digit by digit manipulation, rotate the digit in range of 0 to 9 Windows 8 A challenging digit by digit manipulation, rotate the digit in range of 0 to 9 Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Yup pretty easy. You can put this bit of code in the same module. The variable called ManipRows will allow you to put in any amount of manipulations you want. If it were me I would then put an autoshape on the same sheet where I copy and paste the new data and assign the FormatManipulationSheet code to it. That way when you copy and paste your new data you can just press the button and then everything will be ran. As always save the book before running.
Code:
Sub FormatManipulationSheet()
  'Writes in the data from a worksheet and formats in a way to use the algorithm
  
  Dim CheckRow As Long, ResultRow As Long, wb As Workbook, cws As Worksheet, rws As Worksheet
  Dim LastRow As Long, ManipRows As Integer, Col As Integer, LastCol As Integer, Mrow As Long
  Dim Mcount As Integer
  
  'Set the amount of Manipulation Rows
  ManipRows = 2
  
  'Set the references
  Set wb = ThisWorkbook
  Set cws = wb.Worksheets(1)
  Set rws = wb.Worksheets(2)
  ResultRow = 2
  LastRow = cws.Range("B2").End(xlDown).Row
  LastCol = cws.Range("B2").End(xlToRight).Column
  
  'Set up the headers
  For Col = 2 To LastCol
    rws.Cells(1, Col).Value = cws.Cells(1, Col).Value
  Next Col
  
  
  For CheckRow = 2 To LastRow
    For Col = 2 To LastCol
      rws.Cells(ResultRow, Col).Value = cws.Cells(CheckRow, Col).Value
    Next Col
    Mcount = 1
    For Mrow = ResultRow + 1 To ResultRow + ManipRows
      rws.Range("A" & Mrow).Value = "Manipulation " & Mcount
      Mcount = Mcount + 1
    Next Mrow
    ResultRow = ResultRow + ManipRows + 1
  Next CheckRow
  
  'If you want to have the other code run right after
  'just uncomment the 2 lines below.
  
  'rws.Activate
  'ManipulationAlg
  
End Sub
Let me know if you have any questions or concerns.

Thanks
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
A challenging digit by digit manipulation, rotate the digit in range of 0 to 9 Outlook export to a calendar csv file is transposing single digit starting dates sala-marie Excel 3 10-27-2013 09:32 PM
A challenging digit by digit manipulation, rotate the digit in range of 0 to 9 Recipient counter in Mail Merge Wizard displays only one digit in Word Liuneddu Word 1 08-13-2013 03:57 AM
A challenging digit by digit manipulation, rotate the digit in range of 0 to 9 Import contact from EXCEL to Outlook (no zero in left side digit) nmo111 Outlook 1 05-28-2010 11:00 AM
Dividing merge cell into ten equal rectangles for inputing Digit? aligahk06 Excel 0 05-12-2010 06:56 AM
in WORD, how do i type a 9-digit phone number "xxxxxxxxx" and have it automatically.. jay8962 Word 0 04-08-2010 11:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft