Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Realm Works Forums > Realm Works Discussion

Notices

Reply
 
Thread Tools Display Modes
daplunk
Senior Member
 
Join Date: Jan 2016
Location: Adelaide, Australia
Posts: 2,294

Old February 22nd, 2019, 03:38 PM
Hi Team,

Hoping there are some Excel gurus amongst us who may we able to assist.

I'm creating a macro enabled Excel file that allows you to paste a monster stat-block into it. It rips the paste apart applying all the formatting requirements in line with a standard 5e stat-block and then copies the text into a table.

The intention is that table would then be loaded into the CSV to RW Import Tool. I'm basically trying to make it as efficient as possible to get monsters from a PDF into RW fully formatted.

And I'm close. I have it all working except the final step where I need to copy the formatted cells into a table.

I can copy the values and I've got it working so that it will copy the text in as BOLD.

The challenge I've yet to overcome however is pasting the data in where a single cell contains BOLD, ITALICS and NORMAL text. Monster Attacks obviously have this type of formatting.

Here's the file in case anyone knows the answer. Once done this will be something I upload for the community.

https://drive.google.com/file/d/1gUM...ew?usp=sharing

1. Paste monster stat-block from PDF (note, need to move text to correct lines)
2. Press the button
3. Monster stat-block is converted into format compatible with the CSV to RW Importer


This is where it's going wrong. As you can see I have the formatting working in the Actions 1 cell at the top. This line is then copied into the next available line on the table. It's applying BOLD to the whole line instead of copying the formatting from the source cell.


Realm Works - Community Links
Realm Work and Hero Lab Videos
Ream Works Facebook User Group
CC3+ Facebook User Group

D&D 5e Community Pack - Contributor
General Hero Lab Support & Community Resources
D&D 5e Community Pack - Install Instructions / D&D 5e Community Pack - Log Fault / D&D 5e Community Pack - Editor Knowledge Base

Obsidian
Obsidian TTRPG Tutorials

Last edited by daplunk; February 22nd, 2019 at 03:43 PM.
daplunk is offline   #1 Reply With Quote
Dakadin
Member
 
Join Date: Aug 2013
Posts: 39

Old February 22nd, 2019, 05:48 PM
Try using something like this:
Code:
ThisWorkbook.Worksheets("Sheet1").Range("B1").Copy Destination:=ThisWorkbook.Worksheets("Sheet1").Range("A1")
Dakadin is offline   #2 Reply With Quote
daplunk
Senior Member
 
Join Date: Jan 2016
Location: Adelaide, Australia
Posts: 2,294

Old February 22nd, 2019, 07:28 PM
That's the answer although its not the complete answer!

Copying like that simply replicates the excel copy function. Thus is copies the formulas. So it doesn't work on most of it. It does work on the bits I'm having trouble with. So now I just need to create two separate parts of the copy process.

One for this bit and then a different one for the bits that dont have formatting but have formulas.

Thank you!

Realm Works - Community Links
Realm Work and Hero Lab Videos
Ream Works Facebook User Group
CC3+ Facebook User Group

D&D 5e Community Pack - Contributor
General Hero Lab Support & Community Resources
D&D 5e Community Pack - Install Instructions / D&D 5e Community Pack - Log Fault / D&D 5e Community Pack - Editor Knowledge Base

Obsidian
Obsidian TTRPG Tutorials
daplunk is offline   #3 Reply With Quote
Ash Nazg
Junior Member
 
Join Date: Apr 2018
Posts: 15

Old February 27th, 2019, 08:11 PM
To preserve the multiple text formatting in the cell, you need to use the PasteSpecial method of the destination Range object, and you need to use the xlPasteAllUsingSourceTheme XLPasteType.

Code:
mySourceRange.Copy
myDestinationRange.PasteSpecial Paste:=xlPasteAllUsingSourceTheme
I hope that helps,
~ Ash

Last edited by Ash Nazg; February 28th, 2019 at 11:52 AM.
Ash Nazg is offline   #4 Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT -8. The time now is 01:36 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.